简体   繁体   中英

jQuery/Javascript won't run on my server, local machine only

I've seen a lot of these questions listed but none actually answered the questions. I made a word cloud on a local machine and it worked like a charm. I loaded it onto the server and now the scripts won't run. I thought it might have to do with the src links but I even went so far as to put the full path in there and that didn't help at all.

here is the link to my page: www.johnverber.com/wordcloud/wordcloud.html

Any thoughts or otherwise would be appreciated. Below is the code for my script links:

<link REL = "stylesheet" type = "text/css" href="styles.css">
    <script type="text/javascript"  src =     "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/jquery.js"></script>
<script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/tagtools.js"></script>
<script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/openDocTools.js"></script>
<script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/executeTag.js"></script>

You need to make your paths absolute. Add the http:// before all your script paths. It would also appear that most (if not all) of your scripts are missing from the server.

Look at the net tab in the browser, you will see your urls are wrong.

GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/jquery.js 404 (Not Found) wordcloud.html:6
GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/tagtools.js 404 (Not Found) wordcloud.html:6
GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/openDocTools.js 404 (Not Found) wordcloud.html:6
GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/executeTag.js 404 (Not Found) wordcloud.html:6

Your script paths are wrong, remove the home/johnverb/public_html/ part and include the protocol ie http:// if you are using absolute paths

http://www.johnverber.com/wordcloud/jquery.js
http://www.johnverber.com/wordcloud/openDocTools.js
http://www.johnverber.com/wordcloud/executeTag.js
http://www.johnverber.com/wordcloud/tagtools.js[404 not found]

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