Category Archives: jquery snippets

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]

JQuery Ajax Snippet

JQuery Ajax Snippet

Consider to think about.
Review the code below.

Syntax

[code]$.ajax({
type: 'POST',
url: url,
data: data,
success: success,
dataType: dataType
});[/code]

Example

[code]$.ajax({
type: "POST",
url: document.URL + '/PageList',
data: "{}",
async: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var pages = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;

$('#locPage' + locId).find('option').remove();

$.each(pages, function () {
$('#locPage' + locId).append(
$('&lt;option&gt;&lt;/option&gt;').val(this.PageId).html(this.Name)
);
});
}
});[/code]

MouseOut() and MouseOver() events

.mouseout() – jQuery API