输入新查询字符串/MVC 参数时,Adobe Flex 页面不会刷新
我正在努力向 URL 接受 MVC 风格外观方式定义的参数的位置添加功能。例如。 (www.myurl.com/#viewName/Id/12345)其中12345是我想要获取的相应ID号。
我有这个功能。我使用的是 Internet Explorer 7。
我的问题是,当用户尝试在 URL 中输入新的查询字符串 ID 时,当用户按 Enter 或刷新按钮时,页面不会刷新。 (用户只能在打开新窗口/选项卡时导航到 url/#/Id/12345)
有谁知道这是否是在 Flex 中不起作用的功能,或者是否需要一些代码或配置来允许此功能?谢谢。
I am working on adding functionality to where the URL takes in a parameter as defined by an MVC style looking way. eg. (www.myurl.com/#viewName/Id/12345 ) where 12345 is the corresponding Id number that I want to get.
I have this functionality working. I am using Internet Explorer 7.
My issue is that when a user attempts to enter a new query string id into the URL, the page doesn't refresh when the user hits enter or the refresh button. (The user can navigate to the url/#/Id/12345 only when opening a new window/tab)
Does anyone know if this is a feature that doesn't work in Flex or if there is some code or configuration needed to allow this? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与 Adobe Flex 无关。只是浏览器(我认为其中大部分)。
您会看到,链接的构建方式正是在链接中实现“滚动到页面上的锚点”的方式。例如,在博客文章页面 http://example.com/blogPost1.html 添加 #comments链接末尾并按地址栏上的 Enter 键不会重新加载页面,只需将页面滚动到评论部分即可。浏览器 w
真实示例:转到链接 https://blog.stackoverflow.com/2011/10/ se-podcast-23 页面加载后在链接末尾添加 #comments 并按 Enter。你会看到浏览器不会刷新,只是将页面滚动到评论区。
如果您希望页面按照您的方式运行而不修改链接结构,我认为 JavaScript 会帮助您。一个关于SO的例子: 如何检测地址栏用 JavaScript 改变?
This has nothing to do with Adobe Flex. Is just the browser(most of them I think).
You see, the way how your link is built is exactly how "scroll to anchors on the page" is implemented in links. For example on a blog post page http://example.com/blogPost1.html adding #comments on the end of the link and pressing Enter on the address bar will not reload the page, just scroll the page to the comments section. A browser w
Real word example: go to link https://blog.stackoverflow.com/2011/10/se-podcast-23 after the page loads add at the end of the link #comments and press enter. You will see that the browser will not refresh but just scroll the page to the comments area.
If you want the page to behave in your way without modifying the link structure I think that JavaScript will help you. One example on SO: How can I detect an address bar change with JavaScript?