jQuery not loading

ぐ巨炮叔叔 提交于 2019-12-06 02:56:16

Sounds like a permissions issue on the file itself. Try

chmod 755 /local/path/to/jquery-1.3.2.min.js

I just had a very similar thing happen. What fixed it for me was taking the file that wasn't working and copying the content of the file into a new file. E.G. In my instance, take the JQuery file, open it, copy into a new JS file, save, move old file, put new file in same place with same name... then it all worked fine.

You need to check your users permissions with regards to those directories/files. Consider contacting your host about this issue if you are unable to resolve it yourself.

If apache can read one file but not the other. Check the permissions on the file use chmod or chown and see if that makes a difference. Set the file to the same permissions of the other javascript file that loads fine.

Apart from checking permissions, prefix the path with this and then see:

$_SERVER[DOCUMENT_ROOT];

If the suphp module is enabled in apache you have to adjust the permissions and the owner of the jquery file. Take a look at the permissions of the files with

cd /path/to/scripts
ls -l *.js

if the permissions are different you can adjust the permissions of the jquery-1.3.2.min.js file with e.g.

chmod 664 jquery-1.3.2.min.js

and if the owner is different you can adjust it with

chown user:group jquery-1.3.2.min.js

This solution won't fix your permissions issue, but it's better to load the jQuery library from Google.

Google host several popular JS libraries.

The main advantage is that many people already loaded the file from Google, so they already have it in cache. This way, you save a lot of bandwidth, and pages load faster for most of your visitors.

You can just use this URL to include the api. (more info)

http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!