RyeGuy RyeGuy - 1 month ago 6
Javascript Question

jQuery Script not loading at all

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);
});
});

Answer

You can use CDN. To do that just include this code inside your head tag.

<script src="https://cdnjs.cloudflare.com/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.

Comments