页面网址与IE和Firefox不同

时间:2013-04-17 14:51:27

标签: jquery html internet-explorer firefox

我使用JQuery有这种有线情况。我的网站上有三页。

  1. 的index.html
  2. business.html
  3. operation.htmls
  4. 当我打开business.html网址 firefox 时,它会像这样打开

    http://localhost:9090/Operational/business.html
    

    当我点击此页面上名为“operation.html”的按钮时,它会打开一个包含以下地址的新页面

    http://localhost:9090/Operational/operation.html
    

    直到现在都很好。但是当我在IE 9中打开相同的operation.html页面时,URL是不寻常的:

    http://localhost:9090/Operational/business.html#/Operational/Operations.html
    

    为什么会这样?有人可以对此有所了解吗?我卡住了:P @ !!!!

    添加更多详情

    我正在使用名为tiggzi的开发工具。 这是代码的锚定部分。

    $('#j_2 [name="mobilenavbaritem4_141"]').die().live({
        click: function () {
            if (!$(this).attr('disabled')) {
                Tiggr.navigateTo('Operations', {
                    transition: 'slide',
                    reverse: false
                });
            }
        }
    });
    

3 个答案:

答案 0 :(得分:2)

在没有看到代码的情况下,我们只能推测,但很可能该页面具有更新内容的JavaScript,然后使用the history API来设置可收藏的URI。

IE9不支持历史API,因此它回退到使用片段标识符作为黑客。

如果有人要直接访问http://localhost:9090/Operational/business.html#/Operational/Operations.html,服务器会提供business.html的内容,然后JavaScript会请求Operations.html的内容并替换它。

答案 1 :(得分:0)

那是因为您onclick上可能Anchor tag以及href工作。

如果是这种情况,请将return false;放在onclick的末尾。

答案 2 :(得分:0)

我找到了问题和解决方案。

我正在使用tiggzi的一个名为tiggr的自定义jquery移动库。这导致了IE中的错误。

代码就是这个

Tiggr.navigateTo('Operations', { transition: 'slide', reverse: false })

现在我用

代替了它
window.open('Operations.html', '_self', 'width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')

我知道这个调整在过渡期间有问题,但我可以继续这样做。!

感谢大家的帮助!!!

相关问题