Xtremax - Web Design

29 Mar, 2009

Loading JQuery Dynamically

Posted by: Mr Otter In: jquery

I was always downloading the jquery javascript and playing with its functions until I realised that hey… it can be done dynamically by google.  Basically, it is a 2 step process:

Step 1:  get the jsapi javascript from google

<script src="http://www.google.com/jsapi"></script>

Step 2:  load the jquery library. this is necessary as google has a lot of other libraries…

google.load("jquery", "1");

For a complete source code sample… see below:

 

<script src="http://www.google.com/jsapi"></script>
<script>
  // Load jQuery
  google.load("jquery", "1");

  google.setOnLoadCallback(function() {     
      $("#test").wrap("<b></b>");     
    });
</script>

<div id=’test’>just testing</div>

Bookmark and Share

1 Response to "Loading JQuery Dynamically"

1 | ugg boots

July 7th, 2010 at 1:43 pm

Avatar

Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us new balance 999 valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

Comment Form

Xtremax Web Design Portfolio

    Opera Estate Primary SchoolNational Association of Travel Agents SingaporeFUMIYAMA CORPORATIONEngineering Education PortalBOON HI-TECH SUPERSTORESingapore Tourism Board

About Xtremax

This is all about a group of hard-core web developers who go about rambling about their daily efforts to make the internet world a better and more accessible place.