I will dive straight in, with this being the first blog on the site, I may as well make it about my experience with setting up the blog, preparing it for the many posts to come.
Adding jQuery to blogger.com:
- Login to your blog. At the top right of the page (for me anyway) click Design
- Click on the Edit HTML tab.
- Now search for the line <head>
- Now you need to add the jQuery core (I will be using the Google CDN version), after <head> add the following lines - you will notice I am also adding the jQuery UI aswell:
- Next is to add any jQuery code you want to load with EVERY page:
- Now you can place anything you want to run when the blog loads in the normal way.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"> <script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js' type='text/javascript'/> <link href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css' rel='stylesheet' type='text/css'/>
<script type='text/javascript'> //<![CDATA[ $(document).ready(function() { }); //]]> </script>
If you wanted to turn all buttons that you place on your blog:
Note:
The reason for adding the code between:
Scoobler.
Some jQuery books on Amazon.com:
<input type="button" id="myButton" value="This Button" />Into jQuery UI buttons you could do this:
<script type='text/javascript'> //<![CDATA[ $(document).ready(function() { $(":button").button(); }); //]]> </script>
Note:
The reason for adding the code between:
//<![CDATA[ ..... //]]>Is that when you submit the code, it stops the code being interpreted, and characters being swapped for their ASCII representation. This isn't really a problem for most browsers, but it makes the code much harder to read next time you fancy changing something!
Scoobler.
Some jQuery books on Amazon.com:
No comments:
Post a Comment