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
//Global validation message | |
jQuery.extend(jQuery.validator.messages, { | |
required: "تعبئة هذا الحقل إجباري" | |
}); | |
// New Method like email; this one to check Emirates Id | |
jQuery.validator.addMethod('emiratesId', function (value) { | |
return /^\d{3}-?\d{4}-?\d{7}-?\d{1}$/.test(value); | |
}, 'Please enter a valid Emirates ID number'); | |
// common initialisation |
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
//Invocation with the apply() and call() methods | |
// create a plain function | |
function juggle() { | |
var result = 0; | |
for (var n = 0; n < arguments.length; n++) { | |
result += arguments[n]; | |
} | |
//this.result = result; | |
console.log(result) |
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
//Invocation as a constructor | |
//Ninja is a Constructor | |
//should start with Capital letter | |
//creates a emply object{} | |
function Ninja() { | |
this.skulk = function () { | |
return this; |
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
//Invocation as a function | |
//this refers to window | |
function creep() { | |
return this; | |
} | |
console.log(creep() === window, "Creeping in the window"); | |
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
@media screen and (-webkit-min-device-pixel-ratio:0) { // for chrome | |
} |
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
$(".accord_table").on("change",'.currentTable :checkbox',function(event){ | |
var group = $(this).closest(".currentTable").find(":checkbox"); | |
group.not($(this)).removeProp("checked"); | |
}) |
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
var log_this_and_message = function (message) { | |
console.log(message+this.name); | |
}; | |
var thing = { | |
name: 'Big Hairy Thing' | |
}; | |
log_this_and_message.call(thing, 'Hello!'); |
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 upTo(element, myclassName) { | |
do { | |
element = element.parentNode; | |
if (element.className.indexOf(myclassName) > -1) { | |
return element; | |
} | |
} while (element); | |
return null; | |
} | |
upTo(this, "level-dt"); |
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).keydown(function (e) { | |
if (e.keyCode == 27) | |
{ $(".box_tube,.over_wrapper").fadeOut(500); } | |
}); |
OlderNewer