Linking to external jQuery library: Link to the latest version of the jQuery library stored on an online Content Delivery Network (CDN).
jQuery failed to load
Notes:
<!-- Link to jQuery library stored on a CDN server. -->
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<-- Script to test if jQuery library loaded and use it to set the text of a paragraph named #message -->
<script>
$(document).ready(function(){
$(function(){
if (jQuery) {
// Change #message text to success message if jQuery loads
$("#message").text('jQuery loaded the latest version successfully from an online source!');
}
});
});
</script>
<!-- DIV to display the message. This default failure text would be replaced by jQuery -->
<div id="message">jQuery failed to load.</script>