This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
}); | |
$(function(){ | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('#txtEmail').blur(function() { | |
if(validateEmail('txtEmail')) | |
{ | |
alert('Email is valid'); | |
} | |
else | |
{ | |
alert('Invalid Email Address'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a').each(function() { | |
var a = new RegExp('/' + [removed].host + '/'); | |
if(!a.test(this.href)) { | |
$(this).click(function(event) { | |
event.preventDefault(); | |
event.stopPropagation(); | |
window.open(this.href, '_blank'); | |
}); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Target Safari | |
if( $.browser.safari ) $("#menu li a").css("padding", "1em 1.2em" ); | |
Target anything above IE6 | |
if ($.browser.msie && $.browser.version > 6 ) $("#menu li a").css("padding", "1em 1.8em" ); | |
Target IE6 and below | |
if ($.browser.msie && $.browser.version <= 6 ) $("#menu li a").css("padding", "1em 1.8em" ); | |
Target Firefox 2 and above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseXml(xml) { | |
//find every Tutorial and print the author | |
$(xml).find("Tutorial").each(function() | |
{ | |
$("#output").append($(this).attr("author") + ""); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('#mytarget').load( '/js/remote-file.php', { id: '1' }); | |
}); | |
Call the load function with the address of the script, with optional parameters. | |
Will call /js/remote-file.php?id=1 and return the results inside the div with the id 'mytarget' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get the value of a selected option | |
$('selectElement').val(); | |
//Get the text of a selected option | |
$('#selectElementId :selected').text(); | |
//Remove an option (e.g. id=1) | |
$("#selectElementId option[value='1']").remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#radio').find('option:selected'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($.browser.msie) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("ul > li").click(function () { | |
var index = $(this).prevAll().length; | |
}); |
OlderNewer