This file contains hidden or 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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script>window.jQuery || document.write('<script src="http://www.myurl.com/js/jquery-1.4.2.min.js">\x3C/script>')</script> |
This file contains hidden or 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
var apple = { | |
type: "macintosh", | |
color: "red", | |
getInfo: function () { | |
return this.color + ' ' + this.type + ' apple'; | |
} | |
} |
This file contains hidden or 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 Apple (type) { | |
this.type = type; | |
this.color = "red"; | |
this.getInfo = function() { | |
return this.color + ' ' + this.type + ' apple'; | |
}; | |
} | |
// Or, this other way: |
This file contains hidden or 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
//Find a parent div by id where display is none: | |
/* | |
<div id="#extended_selectors"...> | |
... | |
<span id="lorem"... /> | |
</div> | |
*/ | |
if( $(id).parents().find("#extended_selectors").css('display') == "none" ) { | |
console.log("found"); | |
} |
This file contains hidden or 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
/* | |
ressource: http://css-tricks.com/snippets/javascript/lazy-loading-images/?utm_source=dlvr.it&utm_medium=twitter | |
*/ | |
<img src="blank.gif" class="lazy" data-src="/images/full-size.jpg" width="240" height="152"></a> | |
/* lazyload.js (c) Lorenzo Giuliani | |
* MIT License (http://www.opensource.org/licenses/mit-license.html) | |
* | |
* expects a list of: |
This file contains hidden or 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
/** | |
* Returns the version of Internet Explorer or a -1 | |
* (indicating the use of another browser). | |
*/ | |
function getInternetExplorerVersion() | |
{ | |
var rv = -1; // Return value assumes failure. | |
if (navigator.appName == 'Microsoft Internet Explorer') | |
{ | |
var ua = navigator.userAgent; |
This file contains hidden or 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
$ mysql -uroot -p | |
mysql> create database my_new_database; | |
mysql> grant all on my_new_database.* to new_user@localhost identified by 'my secret password'; | |
mysql> flush privileges; | |
mysql> quit |
This file contains hidden or 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
// http://jsfiddle.net/jquerybyexample/RgLPC/ | |
$(".ui-datepicker-trigger").mouseover(function() { | |
$(this).css('cursor', 'pointer'); | |
}); |
This file contains hidden or 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
var userClickTarget : Point = new Point(tmpXPos, tmpYPos); | |
// read bounds extremes | |
var minAreaX : Number = -1; | |
var maxAreaX : Number = -1; | |
var minAreaY : Number = -1; | |
var maxAreaY : Number = -1; | |
// when an area specified, convert for flash interface to be able to debug display | |
var posLen : uint = targetPosition.xList.length; |
This file contains hidden or 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
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('.phoneInput').keypress(function(key) { | |
if(key.charCode < 48 || key.charCode > 57) return false; | |
}); | |
$('.surnameInput').keypress(function(key) { | |
if((key.charCode < 97 || key.charCode > 122) && (key.charCode < 65 || key.charCode > 90) && (key.charCode != 45)) return false; | |
}); | |
</script> |