I am losing a ton of time trying to diagnose this issue. Any help would be fabulous. This is my first experience using cPanel and I have uploaded my files properly to the public_html
. The stylesheet and html load beautifully but the js file will not. Any suggestions would be great. Here is my code
HTML
<html>
<head>
<link href="" rel="stylesheet">
<script src="jquery-1.12.4.min.js"></script>
</head>
<body>
...
</div>
<script type="text/javascript" src="http://example/test.js"></script>
</body>
</html>
JS
$(document).ready(function() {
$("li.upper").hide();
$("li.lower").hide();
.....
console.log(newContent);
$('#container').html(newContent);
});
});
I am losing a ton of time trying to diagnose this issue. Any help would be fabulous. This is my first experience using cPanel and I have uploaded my files properly to the public_html
. The stylesheet and html load beautifully but the js file will not. Any suggestions would be great. Here is my code
HTML
<html>
<head>
<link href="http://test.css" rel="stylesheet">
<script src="jquery-1.12.4.min.js"></script>
</head>
<body>
...
</div>
<script type="text/javascript" src="http://example/test.js"></script>
</body>
</html>
JS
$(document).ready(function() {
$("li.upper").hide();
$("li.lower").hide();
.....
console.log(newContent);
$('#container').html(newContent);
});
});
Share
Improve this question
edited Oct 11, 2016 at 20:25
marc_s
756k184 gold badges1.4k silver badges1.5k bronze badges
asked Aug 21, 2016 at 21:58
RyeGuyRyeGuy
4,50310 gold badges35 silver badges62 bronze badges
3
- 3 You need to place your version of jquery in the public_html directory. – stevenelberger Commented Aug 21, 2016 at 22:00
- Is there any error in console ? – w411 3 Commented Aug 21, 2016 at 22:04
- No error in the console. I'll try placing a version of jQuery in my public directory – RyeGuy Commented Aug 21, 2016 at 22:11
2 Answers
Reset to default 8You can use CDN. To do that just include this code inside your head tag.
<script src="https://cdnjs.cloudflare./ajax/libs/jquery/2.2.4/jquery.min.js"></script>
and delete this line of code
<script src="jquery-1.12.4.min.js"></script>
other wise download jquery library from this link and paste it on the public_html directory.
That is because you are telling the browser to load "jquery-1.12.4.min.js" from your public_html directory but we can see from the screenshot of your folder that it is not there in your public_html directory.