Brian's Blog

items I see across my tribes

Adding jQuery to BE.N

January 17
by briancarter 17. January 2010 16:57

image

Getting into jQuery – it would be nice to have jQuery items on my blog site. 


In this post, I show how to add it along with some things to watch out for.

I tried adding the jQuery JS file reference to the admin section – settings page: “HTML head section” and “Tracking script” areas without success.  I then tried the site.master, in the themes directory, which would only load the script once per page.  The jQuery script likes to sit right above the </head> section.  

Update your site.master:  Add in jQuery.js.

image

 

The next issue – collisions with BE.N’s script.  Appears they both use $.  To resolve this, add: $j = jQuery.noConflict();  -> to all your jQuery scripts where you reference $.  Now user “j$” instead of “$”.  I know it’s a pain – but the value of BE.N out weights it.

 Below is an example showing how to user jQuery.  The code, get it here, shows calling events and calling a custom function (for left padding). 

jQuery Example

Associate click event and Creating jQuery functions


 

Thank You for listening.

jQuery_example_date.zip (616.00 bytes)

Categories:

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading




 Questions or Feedback, my contact information is located on my About page.


The opinions, thoughts, and comments made in these blog posts are solely my own (unless otherwise stated). They do not reflect the opinions, thoughts or practices of my employer, my universities, my family, or anyone else. Also, I retain the right to change my mind about anything I publish here without having to go back and edit posts that occurred in the past. 

These are my opinions, or just as likely, someone else's opinions that I leveraged for my own.