BrowserManager Returns null - Flex 4.5
发布时间:2020-12-15 04:47:22 所属栏目:百科 来源:网络整理
导读:Summary: 由于Flex做客户端的系统要与JSP客户端的系统交互,选择用BrowserManager 来接受参数。 突然有一天发现,BrowserManager 接受不到任何参数了,无论浏览器的地址栏输入什么,在Flex端都读不到任何数据。 在google上找了一下,找到了解决办法:http://
Summary: 由于Flex做客户端的系统要与JSP客户端的系统交互,选择用BrowserManager 来接受参数。 突然有一天发现,BrowserManager 接受不到任何参数了,无论浏览器的地址栏输入什么,在Flex端都读不到任何数据。 在google上找了一下,找到了解决办法:http://stackoverflow.com/questions/6784494/browsermanager-returns-null-flex-4 最详细的就是这篇文档了,http://flexperiential.com/2010/05/06/browsermanager-returns-null/ 对照生成的html,发现 这句话? <script src="history/history.js"></script>
被注释掉了。 把这句话放开,问题就解决了。 原来BrowserManager类是用history.js这个JS类来读取浏览器地址的内容的。 /* Get the current location hash excluding the '#' symbol. */ function getHash() { // It would be nice if we could use document.location.hash here,// but it's faulty sometimes. var idx = document.location.href.indexOf('#'); return (idx >= 0) ? document.location.href.substr(idx+1) : ''; } /* Get the current location hash excluding the '#' symbol. */ function setHash(hash) { // It would be nice if we could use document.location.hash here,// but it's faulty sometimes. if (hash == '') hash = '#' document.location.hash = hash; } function createState(baseUrl,newUrl,flexAppUrl) { return { 'baseUrl': baseUrl,'newUrl': newUrl,'flexAppUrl': flexAppUrl,'title': null }; } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |