从移动设备单击“查看桌面站点”时重定向错误

时间:2019-02-02 18:11:32

标签: html redirect mobile widget desktop

在移动网站的底部,有一个使用此代码的“查看桌面网站”链接

    <script type="text/javascript">
    function nonMobile()
    {
        window.location = "http://www.website.com/?m=no";
    }
    </script>
    <button onclick="nonMobile()">Desktop Version</button>

widgetbox中曾经有一个widget,它允许重定向工作,但是由于widgetbox现在不可用,该代码已被删除,因为它正在重定向到“ www1.webserver.com”或类似的内容。 / p>

现在,发生的错误是这个循环中断,它不断尝试重定向到桌面站点,但被卡住了。我看到它试图在控制台中重定向到的URL是“ https://www.website.com/?m=no/mobile_index.html/mobile_index.html/mobile_index.html/mobile_index.html”。

我得到的主要警告是:

  

”页面位于   https://website.com/?m=no/mobile_index.html/mobile_index.html/mobile_index.html/mobile_index.html   被允许显示来自   http://www.website.com/folder/imagefile.jpg。”

此警告与其他内容一起出现很多次。

我尝试使用“ https”将函数中的url更改为“ https://www.website.com/?m=no”和“ https://website.com/?m=no”,但是发生相同的错误。当我执行“ https://website.com/?m=no”时,与其他人相处的唯一不同错误是:

  

“无法加载网址:此网址的域未包含在应用程序的   域。为了能够加载此URL,请添加所有域和子域   进入应用程序设置中的“应用程序域”字段。”

0 个答案:

没有答案