简体   繁体   English

jQuery.load不在Chrome和IE中加载

[英]jQuery.load doesn't load in Chrome and IE

At first, jQuery loads correctly in localhost(XAMPP) but it doesn't load anything when opened on ftp (using FileZilla to upload to ftp). 首先,jQuery可以在localhost(XAMPP)中正确加载,但是在ftp上打开(使用FileZilla上载到ftp)时却不加载任何内容。

Update (edited) : It works correctly only in Firefox. 更新(已编辑) :仅在Firefox中可以正常工作。 The symptom that firefox has different from other browsers is, it asks multiple permissions to fill ID and password before I can reach the first index site while other ask only 1 time. firefox与其他浏览器不同的症状是,它会要求多个权限来填充ID和密码,然后我才能到达第一个索引站点,而其他浏览器只会问一次。

Here is my code where it should load. 这是我应该加载的代码。

HTML : HTML:

<button onclick="setLayout('layout2.html');">Layout2 F</button>
<div id="layout-grid"></div>

Javascript : Javascript:

function setLayout(selectedLayout) {
     $("#layout-grid").load("custom/layout/layout2.html");
}

I tried change to .txt and absolute url ftp.77-house.com:2002/custom/layout/layout2.html but still doesn't work. 我尝试更改为.txt和绝对URL ftp.77-house.com:2002/custom/layout/layout2.html但仍然无法正常工作。 No error is shown in console after all. 毕竟,控制台中不会显示任何错误。 What am I missing here ? 我在这里想念什么? Is it about something get blocked for security or something in addition blocking it from loading external ftp ? 是出于安全性考虑而进行阻止,还是阻止其加载外部ftp?

Thank you in advice ! 谢谢指教! Hope you can help my first time using ftp. 希望您能帮我第一次使用ftp。

It looks like it's a path/url problem. 看来这是路径/网址问题。

Try this: 尝试这个:

$("#layout-grid").load("http://yoursite/custom/layout/layout1.html");

There might be couple things you need to check. 您可能需要检查几件事情。 First make sure your url is correct. 首先,请确保您的网址正确。 Second, check CHMOD for files that you want to access. 其次,检查CHMOD中要访问的文件。 Somehow, they might be restricted.Set permissions correctly then you will be fine 不知何故,它们可能会受到限制。正确设置权限,然后就可以了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM