I have the following script in my smarty template:
<script src="http://code.jquery.com/jquery-latest.js">
$(document).ready(myBookings);
</script>
However it doesn't work on page load. $(document).ready(myBookings);
does work when I run it in Mozilla firebug console though. What am I doing wrong?
script
elements can have a src
attribute or content, but not both. If they have both, the content is ignored (the content is considered "script documentation," not code).
Use another script block for your document-ready handler
<script src="http://code.jquery.com/jquery-latest.js">
</script>
<script>
$(document).ready(myBookings);
</script>