I'm attempting to create a very simple HTML document with an even less plex $(document).ready()
function. However.... nothing in the function will fire. I've set alerts and breakpoints (in Chrome's debugger) and nothing works. Below is the markup.
<!DOCTYPE HTML>
<html>
<head>
<script src=".11.0.min.js" />
<script>
alert('outside');
$(document).ready(function() {
alert('here');
});
</script>
</head>
Neither alerts work. Not sure what I'm doing wrong here.
I'm attempting to create a very simple HTML document with an even less plex $(document).ready()
function. However.... nothing in the function will fire. I've set alerts and breakpoints (in Chrome's debugger) and nothing works. Below is the markup.
<!DOCTYPE HTML>
<html>
<head>
<script src="http://code.jquery./jquery-1.11.0.min.js" />
<script>
alert('outside');
$(document).ready(function() {
alert('here');
});
</script>
</head>
Neither alerts work. Not sure what I'm doing wrong here.
Share Improve this question edited Apr 20, 2014 at 20:46 NealR asked Apr 20, 2014 at 20:40 NealRNealR 10.7k61 gold badges167 silver badges306 bronze badges 3- Do you get any errors in the console? – SLaks Commented Apr 20, 2014 at 20:41
- Is this all the code? it seems like it was cut in the middle - or maybe this is the problem :) – Yaron U. Commented Apr 20, 2014 at 20:42
- My apologies, I assumed it went w/o saying that I had closed the tags (my mistake). @SLaks - No, I don't get any errors in the console at all. The page loads without incident. – NealR Commented Apr 20, 2014 at 20:47
2 Answers
Reset to default 9change <script src="http://code.jquery./jquery-1.11.0.min.js" />
to
<script src="http://code.jquery./jquery-1.11.0.min.js"></script>
<script>
alert('outside');
$(document).ready(function() {
alert('here');
});
</script>
you forgot to close the arches. and the closing tag of script.