Flex 应用程序中的深度链接
我目前正在构建一个 Flex 应用程序,并希望允许深度链接生成漂亮的 URL,例如 http://site。 com/#/account/settings 等等。
我查看了 swfaddress 2.4 和 swfobject 2.2 来嵌入 swf 并提供深度链接。到目前为止,Firefox 和 Chrome 中一切正常。然而,在 Internet Explorer 9 中,后退按钮和历史记录功能不起作用,这相当令人沮丧。
有趣的是,Flex 示例文件位于 http://www.asual.com/swfaddress/samples/flex / 在 IE9 中完美运行。经过进一步检查,他们似乎正在使用 ac_OETags.js 文件来嵌入他们的 swf。浏览文档以及由flex生成的index.html文件,似乎他们现在使用最新版本的swfobject作为嵌入swf文件的首选方式。
话说回来,swfobject已经有一年多没有更新了。我也不确定作者是否打算更新它。另一方面,我不喜欢adobe的history.js深度链接的工作方式。在我看来,诸如 http://site.com/#view=1 之类的网址看起来非常难看。
鉴于上述情况,您建议使用哪些库来在 Flex 4.5 项目中嵌入 swf 文件和深度链接?
I am currently building a flex application and would like to allow deeplinking to produce nice URLS such as http://site.com/#/account/settings and so on.
I have looked at swfaddress 2.4 and swfobject 2.2 to embed the swf and provide the deeplinking. So far everything works in Firefox and Chrome. However, in Internet Explorer 9, the back button and history functionalilty does not work, which is rather frustrating.
Interestingly, the Flex sample file here http://www.asual.com/swfaddress/samples/flex/ works pefectly in IE9. Upon futher inspection, it seems that they are using the ac_OETags.js file to embed their swf. Going through the documentation as well as the index.html file generated by flex, it seems that they are now using the latest version of swfobject as the preferred way to embed swf files.
Having said that, swfobject haven't been updated for more than a year. I am also unsure as to whether the author intends to update it. On the other hand, I do not like the way adobe's history.js works for deeplinking. Urls such as http://site.com/#view=1 looks very ugly in my opinion.
In light of the above, what libraries do you recommend for embedding swf files and deeplinking in a flex 4.5 project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这两个是最好的,我建议您都使用。话虽如此,我会尝试调试 javascript/flex 以了解为什么它在 IE9 中不起作用,并修复两个开源项目上的代码,以便其他开发人员可以从中受益。
Those 2 are the best out there and I recommend you use both. With that said, I would try to debug the javascript/flex to see why this isn't working in IE9 and fix the code on both open source projects so that other developers can benefit from it.
发生这种情况的原因是 Adobe 在 IE9 发布后从未更新过 History.js。其中有代码可以处理一些被错误触发的 IE7 错误。
要修复您的history.js,请插入以下代码:
在第22行之后插入:
在第72行之后(第71行是什么):
这应该可以修复它。
The reason this is happening is that Adobe never updated history.js after IE9 came out. There is code in there to handle some IE7 bugs which is being incorrectly triggered.
To fix your history.js insert the following code:
After line 22 insert:
After line 72 (what was line 71):
That should fix it.