简体   繁体   中英

My jQuery ,jQuerymobile code doesn't work on PC, but perfectly on server

I was working on a code using jQuery, jQuerymobile, and soundcloud API. The code works perfectly on server and on jsfiddle.net but when I run it locally it does not work. I've tried it with a local copy of jQuery library but it still does not work on a PC. Any suggestions? Thank you!

How are you loading the JavaScript files? Maybe you have script tags with a protocol-relative URL, such as:

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

If this is the case, things aren't working locally because it's looking in a local file system protocol instead of HTTP. You can just change this to use the absolute form of the URL:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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