Google AJAX Libraries CDN for jQuery

0 votes

I have a page where I need SWFObject, jQuery and Google Maps API. I thought that I could use the benefits of using:

<script type="text/javascript" src="http://www.google.com/jsapi?key=INSERT-YOUR-KEY"></script>
<script type="text/javascript">
    google.load("jquery", "1.4.1");
    google.load("swfobject", "2.2");
    google.load('maps', '2', {'callback': googleMapSetup });
</script>

But now I read somewhere (http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/) that I need to use

google.setOnLoadCallback(function() {
    // Place init code here instead of $(document).ready()
});

instead of $(document).ready().. Is this true?

May 27, 2022 in Java by Edureka
• 13,670 points
1,091 views

1 answer to this question.

0 votes
The Google Hosted Libraries is a stable, reliable, high-speed, globally to be had content material distribution community for the maximum popular, open-supply JavaScript libraries.

Google works immediately with the important thing stakeholders for every library attempt and accepts the today's variations as they're released.

Libraries
To load a hosted library, replica and paste the HTML snippet for that library (proven below) on your net page. For instance, to load jQuery, embed the  snippet on your net page.

We advocate which you load libraries from the CDN through HTTPS, even in case your very own internet site handiest makes use of HTTP. Nowadays, overall performance is fast, and caching works simply the same. The CDN`s documents are served with CORS and Timing-Allow headers and allowed to be cached for 1 year.
answered May 30, 2022 by gaurav
• 23,260 points

Related Questions In Java

0 votes
1 answer

jQuery AJAX submit form

There is a simple input mentioned below ...READ MORE

answered Feb 8, 2022 in Java by Soham
• 9,700 points
1,248 views
0 votes
1 answer

This page didn't load Google Maps correctly. See the JavaScript console for technical details

The solution to your query is relatively ...READ MORE

answered Feb 11, 2022 in Java by Rahul
• 9,670 points
557 views
0 votes
1 answer

jQuery fix for "Uncaught TypeError: $ is not a function" error

 Use the following lines of code in ...READ MORE

answered Feb 16, 2022 in Java by Aditya
• 7,680 points
1,626 views
0 votes
1 answer

jquery $.each() for objects

The $.each() works for objects and arrays ...READ MORE

answered Feb 16, 2022 in Java by Aditya
• 7,680 points
298 views
0 votes
1 answer

I am learning looping statements. Can you tell me how 'for-each' works in Java?

While programming we often write code that ...READ MORE

answered Apr 17, 2018 in Java by Rishabh
• 3,620 points
659 views
+1 vote
1 answer

concat() vs “+” operator : In Java for String concatenation

Basically, there are two important differences between ...READ MORE

answered Apr 27, 2018 in Java by Rishabh
• 3,620 points
4,428 views
0 votes
3 answers

How to check whether a string is empty or not? Is there a function for this?

str != null && str.length() != 0 alternatively str ...READ MORE

answered Sep 11, 2018 in Java by Sushmita
• 6,910 points
977 views
0 votes
1 answer

Need for finalize() in Java

finalize() is a method called by the ...READ MORE

answered May 9, 2018 in Java by code.reaper12
• 3,500 points
500 views
0 votes
1 answer

Wait until all jQuery Ajax requests are done?

You may need to run certain code ...READ MORE

answered May 30, 2022 in Java by gaurav
• 23,260 points
14,553 views
0 votes
1 answer

jQuery.click() vs onClick

So, using a string that is tied ...READ MORE

answered May 30, 2022 in Java by gaurav
• 23,260 points
4,151 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP