Format:
Recent snippets matching tags of jquery
$(document).ready(function () { if (window.location.protocol == 'https:') { $("a[href^='http:\/\/" + window.location.hostname + "']").each(function() { this.href = this.href.replace(/^http:/i, "https:"); }); }; });
18 Views
no comments
(function ($) { $.fn.timeKeys = function (options) { /// <summary> /// Attaches a set of hotkeys to time fields /// + Add minute - subtract minute /// H Subtract Hour R Add houR /// ? Show keys /// </summary> /// <param name="options" type="object">
274 Views
no comments
jQuery(document).ready(function(){ jQuery(document).ajaxSend(function(e,XHR,options){ //loading提示 hb.util.Message.show({ msg:hb.util.context.msg.comm_loading, isCompleteClear:true, bar:[] }); }).ajaxError(function(e,XHR,settings,thrownError){
72 Views
no comments
/* Google jquery CDN <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> */ $.ajax( { type: "POST", contentType: "application/json; charset=utf-8", url: "services/FeedService.svc/ServiceMethod", data: '{"param1":"data1" , "param2":"data2"}', dataType: "json",
63 Views
no comments
/// <summary> /// Internally used Page instance so we can get access to /// a Page instance when no Page might be available. To Access ClientScript etc. /// </summary> private static Page CachedPage { get { if (_CachedPage == null) _CachedPage = new Page();
85 Views
1 comments
$('input:checkbox').addClass(function (index, currentClass) { var addedClass; if (currentClass === "") { addedClass = "rTick"; } return addedClass; });
104 Views
no comments
$(window).load(function() {
(function ($) {
$.fn.vAlign = function() {
return this.each(function(i){
var ah = $(this).height();
var ph = $(this).parent().height();
var mh = (ph - ah) / 2;
$(this).css('margin-top', mh);
});
};
124 Views
1 comments
$.ajax({
url: 'Service.asmx/Method',
type: 'POST',
contentType: 'application/json',
data: '{"Parameters":"Must be JSON strings!"}',
success: function(response) {
// Don't forget that the response is wrapped in a
// ".d" object in ASP.NET 3.5 and later.
console.log(response.d);
}
99 Views
no comments
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>JQuery for Absolute Beginners</title> <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.js" type="text/javascript"></script> <!--<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.min.js" type="text/javascript"></script>--> <link href="Content/Play.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(document).ready(function () {
181 Views
no comments
if (!JSON) { // Autoload JSON2.js if possible // Note: if using a script loader you may have to explicitly load json2.js // assumes loading from same folder as this script var scripts = $("script"); var src = null; scripts.each(function (i) { src = $(this).attr("src"); if (src && src.toLowerCase().indexOf("serviceproxy.") > -1) { src = src.toLowerCase();
356 Views
no comments
$.ajaxSetup({
converters: { "text json": function (jsonString) {
var res = JSON.parseWithDate(jsonString);
if (res && res.hasOwnProperty("d"))
res = res.d;
return res;
} }
});
227 Views
no comments
$("#loading_animation").bind({ ajaxStart: function() { $(this).show(); }, ajaxStop: function() { $(this).hide(); } });
495 Views
no comments
function updatePerson() { person.firstName = "Jimmy"; person.lastName = "Row"; $(person).trigger("changeData",["firstName",person.firstName]) .trigger("changeData",["lastName",person.lastName]); }
349 Views
no comments
jQuery("#list").tableDnD({
onDrop: function(table, row) {
var oldIndex = row.id;
var newIndex = row.rowIndex;
if (oldIndex == newIndex)
392 Views
no comments
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" media="screen" href="/css/redmond/jquery-ui-1.7.2.custom.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/css/ui.jqgrid.css" /> <script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="/js/grid.locale-en.js" type="text/javascript"></script> <script src="/js/jquery.jqGrid.min.js" type="text/javascript"></script>
1028 Views
no comments
$(document).ready(function() { // Initialise the first table (as before) $("#table-1").tableDnD(); // Make a nice striped effect on the table $("#table-2 tr:even').addClass('alt')"); // Initialise the second table specifying a dragClass and an onDrop function that will display an alert $("#table-2").tableDnD({
553 Views
no comments
function(a){if(a=$(typeof a=="string"?"#"+a:a).get(0)){a=a.contentWindow||a.a;if(a.document)a=a.document;return a}};
204 Views
no comments
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Html Template</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> .primary { background-color: green; } .secondary { background-color: blue; }
783 Views
no comments
/* Refresh page content every 10 seconds. */ setInterval(function() { $("#refresh").load(location.href+" #refresh>*",""); }, 10000); // seconds to wait, miliseconds /*
193 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
