I am trying to call a jquery function from html, but it seems that it’s not working. I have my jsfiddle page set to pure js (no libraries being loaded for me) as I am trying to load them in html myself. Any ideas why this function isn’t being called? If I set the jquery library in jsfiddle, then it works.
jsfiddle.net/qD6PN/
p.s.
The reason I don’t want to load the library in through the jsfiddle UI is because I am trying to figure out why my script isn’t being called correctly in MVC, so I don’t want jsfiddle to do anything special.
Thanks!
Put simply, JSFiddle will put everything in the HTML section into the
<body>of your HTML document (it’s not meant to have a<head>as near as I can tell). You can put a<script>tag in the HTML but it will be loaded after anything in the Javascript pane, which is placed in the actual<head>produced by the JSFiddle.If having JSFiddle wrap your HTML and code in its own tags makes your test case problematic, you can try jsbin which includes libraries exactly the way you are doing in this fiddle, by adding
scripttags to thehead.