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
jQuery.expr[':'].regex = function(elem, index, match) { | |
var matchParams = match[3].split(','), | |
validLabels = /^(data|css):/, | |
attr = { | |
method: matchParams[0].match(validLabels) ? | |
matchParams[0].split(':')[0] : 'attr', | |
property: matchParams.shift().replace(validLabels,'') | |
}, | |
regexFlags = 'ig', | |
regex = new RegExp(matchParams.join('').replace(/^\s |\s $/g,''), regexFlags); |
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
setTimeout(“inittab1();“, 500); | |
setTimeout(“inittab2();“, 1000); | |
setTimeout(“inittab3();“, 2000); | |
setTimeout(“initontology();“, 6000); |
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
// This will forcefully reload the current page. No jQuery needed here. | |
location.reload(true); | |
// If your content might be cached by proxy servers and your URL has no query string, try this: | |
location.replace( | |
location.href.replace(/\?.*$/, '') + '?' + Math.random()); |
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
// For jQuery 1.2 | |
jQuery.extend( | |
jQuery.expr[':'], { | |
Contains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" | |
}); | |
// For jQuery 1.3 (thanks @user95227) and later you need |
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
<html> | |
<body> | |
<input type="text" id="clock" /> | |
<script language=javascript> | |
var int=self.setInterval("clock()",1000); | |
function clock() | |
{ | |
var d=new Date(); | |
var t=d.toLocaleTimeString(); |
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 (testarray.length <1) alert("array is empty"); | |
//or | |
if(A && A.length==0) | |
//or if you have other objects that A may be: | |
if(A && A.constructor==Array && A.length==0) |
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
// construct for explorer compatibility | |
var newwindow = ''; | |
// EG: pop_up_window("http://www.google.com", 200, 200) | |
function pop_up_window(url, sizeh, sizew) { | |
if (!newwindow.closed && newwindow.location) { | |
newwindow.location.href = url; | |
} | |
else { | |
newwindow=window.open(url,'name','height=' + sizeh + ', width=' + sizew + ', status=1, resizable=1, location=1, scrollbars=1 '); /*resizable=1*/ | |
if (!newwindow.opener) newwindow.opener = self; |
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
popupWins = new Array(); | |
function windowOpener(url, name, args) { | |
/******************************* | |
the popupWins array stores an object reference for | |
each separate window that is called, based upon | |
the name attribute that is supplied as an argument | |
*******************************/ | |
if ( typeof( popupWins[name] ) != "object" ){ | |
popupWins[name] = window.open(url,name,args); |
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 ($('#keks').html()) { | |
// Do something to remedy the situation | |
} |
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
$('#clickme').click(function() { | |
$('#book').toggle('slow', function() { | |
// Animation complete. | |
}); | |
}); |
NewerOlder