Reputation:
I am testing an html webpage and in the browser it's not working .It is failing to load:
src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"
this is the error:
GET file://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js net::ERR_FILE_NOT_FOUND
and I'd like to question another error in the same html webpage that is the following:
Uncaught ReferenceError: $ is not defined at files.html:337
this is the script:
$('.toggle').click(function (e) {
e.preventDefault();
var $this = $(this);
if ($this.next().hasClass('show')) {
$this.next().removeClass('show');
$this.next().slideUp(350);
} else {
$this.parent().parent().find('li .inner').removeClass('show');
$this.parent().parent().find('li .inner').slideUp(350);
$this.next().toggleClass('show');
$this.next().slideToggle(350);
}
});
Upvotes: 0
Views: 171
Reputation: 944
Instead of
src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"
Use
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"
Upvotes: 1