Category Archives: javascript snippets

Dinamically include jQuery

[javascript]
if(!(window.jQuery && window.jQuery.fn.jquery == ’1.3.2′))
{
var s = document.createElement(‘script’);
s.setAttribute(‘src’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js’);
s.setAttribute(‘type’, ‘text/javascript’);
document.getElementsByTagName(‘head’)[0].appendChild(s);
}
[/javascript]

Include JQuery UI framework from Google libs

Code snippet to include JQuery UI framework from Google libs

[javascript]
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
</head>
[/javascript]