BrowserManager Returns null - Flex 4.5

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 };
    }




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值