First you need to download the source and include it in your document head:-
<script type="text/javascript" src="/scripts/jquery-version.js"></script>
To get jQuery working, you call it like so:
<script type="text/javascript">
<!--
// jQuery starts
$(document).ready(function() {
// .....
Jquery instructions in here
$( 'some selector' ).dostuff () {
..... stuff to do
});
//jQuery ends
});
-->
</script>
Problem is, you now have to use jQuery-type signifiers to call functions from your included script/s. It uses $ as a universal reference to itself - which I find confusing!
You can also change to using jQuery instead of the dollar sign. I have a feeling I may end up doing that, but for now I'm sticking to putting all my jQuery calls inside the
$(document).ready( function, on the
basis that it should be safer
Even though I'm decidedly not target audience, I found this
helpful:
jQuery for Javascript programmers
as well as this:
Getting Started with jQuery
2nd February 2008
Latest comment:
leave a comment / close book