0

I'm following a guy's example fiddling but despite him added the jQuery on the left, the script doesn't execute on run.

//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
$(document).ready(function(){
  alert("hjk");
});

I can't ask him, so I wonder what simple thing I can be missing.

I've checked that the syntax is correct on jQuery's page here. The link to jQuery library is mentioned here.

Community
  • 1
  • 1
  • You have to add jquery library there. https://jsfiddle.net/9upkgsLz/1/ – Rajaprabhu Aravindasamy Apr 03 '16 at 16:01
  • It's added on the left pane. It's from the link in my question. What else should be added? –  Apr 03 '16 at 16:04
  • 1
    the link you have included points to 404 error (https://jsfiddle.net/9upkgsLz/ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js) you most likely missed the first `/` of the `//` you were supposed to copy. – Gabriele Petrioli Apr 03 '16 at 16:04
  • @GabyakaG.Petrioli Strange. When I click on the link to js.min on the left, I get the text file on the screen. It's [this link](//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js)... I removed it and pasted again and it seems to solve the issue. Weird... –  Apr 03 '16 at 16:09
  • 1
    Look at error thrown in browser console. It clearly shows that `$` is undefined and also path is incorrect in your demo. Always check console for errors!! – charlietfl Apr 03 '16 at 16:11

1 Answers1

1

Just click the Javascript button on the top right of the javascript content box and choose jquery as framework, you can also choose between onDomready and onLoad. No need to manually add the jquery js on the left pane.

Also the js code inside the javascript content box shouldn't be wrapped in anything like $(document).ready since jsfiddle already does that.

seahorsepip
  • 4,519
  • 1
  • 19
  • 30