This is a good javascript plugin that loads jQuery async and runs document.ready after jQuery is loaded and DOM initilized.
http://www.yterium.net/jQl-an-asynchronous-jQuery-Loader
http://www.yterium.net/jQl-an-asynchronous-jQuery-Loader
var myclass = function (arg) {
console.log("Class initiated" );//Check object is initiated or not
this .arg = arg;
}myclass.prototype.myfunc = function () {
console.log(this .arg);
}function TestOops() {
var c = new myclass("obj1" ); //create first instance for myclass
c.myfunc();//prints obj1
var d = new myclass("obj2" );//create second instance for myclass
d.myfunc(); //prints obj2
c.myfunc(); //prints obj1
}function MyCallback(name, callbakFn) {
if (typeof (callbakFn) == 'function' ) {
callbakFn.call(this , name);
}}function TestCallback() {
MyCallback('sriram' , function (arg) {alert(arg);
});}(function ($) {
$.fn.toTitleCase = function () {
$(this ).each(function () {
var headline = $(this ).text();
$(this'\uc1\u8216?\uc1\u8217?"\uc1\u8220?.@:\\/\\{\\(\\[<>_]+-? *)/g, function (match, pl, index, title) {
if (index > 0 && title.charAt(index - 2) !== ":" && match.search(/^(a(nd?|s|t)?|b(ut|y)|en|for|i[fn]|o[fnr]|t(he|o)|vs?\\.?|via)[ \\-]/i) > -1)
return match.toLowerCase();
if (title.substring(index - 1, index +'"_{(\\[]/) > -1)
return match.charAt(0) + match.charAt(1).toUpperCase() + match.substr(2);
if (match.substr(1).search(/[A-Z]+|&|[\\w]+[._][\\w]+/) > -1 || title.substring(index - 1, index + 1).search(/[\\])}]/) > -1)
return match;
return match.charAt(0).toUpperCase() + match.substr(1);
}));});};})(jQuery);String.prototype.toTitleCase = function () {
return this'\uc1\u8216?\uc1\u8217?"\uc1\u8220?.@:\\/\\{\\(\\[<>_]+-? *)/g, function (match, p1, index, title) {
if (index > 0 && title.charAt(index - 2) !== ":" &&
match.search(/^(a(nd?|s|t)?|b(ut|y)|en|for|i[fn]|o[fnr]|t(he|o)|vs?\\.?|via)[ \\-]/i) > -1)
return match.toLowerCase();
if (title.substring(index - 1, index +'"_{(\\[]/) > -1)
return match.charAt(0) + match.charAt(1).toUpperCase() + match.substr(2);
if (match.substr(1).search(/[A-Z]+|&|[\\w]+[._][\\w]+/) > -1 ||
title.substring(index - 1, index + 1).search(/[\\])}]/) > -1)return match;
return match.charAt(0).toUpperCase() + match.substr(1);
});};function getAllQueryString() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf( ) + 1).split( );
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split( );vars.push(hash[0]);
vars[hash[0]] = hash[1];
}return vars;
}function getQueryString(name) {
return getUrlVars()[name];
}var hID = getQueryString( );
var sw1 = window.open(urlPath,"windowname" , settings);
if (sw1)
sw1.focus();
else
alert("Popup blocker detected" );<script type="text/javascript"> function fn_Email_Check(Chartocheck) {
var rx = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9\\-\\.]+[^_@])+\\.([A-Za-z]{2,4})$/;
if (rx.test(Chartocheck) == false )
return false ;
else
return true ;
}</script> <html> <head> <script type="text/javascript"> var c = 0;
var t;
var timer_is_on = 0;
function timedCount() {
document.getElementById( ).value = c;c = c + 1;
t = setTimeout("timedCount()" , 1000);
}function doTimer() {
if (!timer_is_on) {
timer_is_on = 1;
timedCount();
}}</script> </head> <body> <form> <input type="button" value="Start count!" onclick="doTimer()"> <input type="text" id="txt" /> </form> </body> </html><script type="text/javascript"> //Function to validate Email
function IsValidEmail(email) {
//var exclude=/[^@\\-\\.\\w]|^[_@\\.\\-]|[\\._\\-]{2}|[@\\.]{2}|(@)[^@]*\\1/;
var exclude = /[^@\\-\\.\\w]|^[_@\\.\\]|[\\._\\-]{2}|[@\\.]{2}|(@)[^@]*\\1/;
var checkend = /\\.[a-zA-Z]{2,3}$/;
if ((email.search(exclude) != -1) || (email.search(checkend) == -1)) {
return false ;
}atPos = email.indexOf("@" , 0);
pPos1 = email.indexOf("." , 0);
periodPos = email.indexOf("." , atPos);
pos1 = pPos1;
pos2 = 0;
while (pos2 > -1) {
pos2 = email.indexOf("." , pos1 + 1);
if (pos2 == pos1 + 1) {
return false ;
} else {
pos1 = pos2;
}}if (atPos == -1) {
return false ;
}if (atPos == 0) {
return false ;
}if (pPos1 == 0) {
return false ;
}if (email.indexOf("@" , atPos + 1) > -1) {
return false ;
}if (periodPos == -1) {
return false ;
}if (atPos + 1 == periodPos) {
return false ;
}if (periodPos + 3 > email.length) {
return false ;
}return true ;
}</script>
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
return this.replace(/\s+$/,"");
} function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function ltrim(stringToTrim) { return stringToTrim.replace(/^\s+/,""); } function rtrim(stringToTrim) { return stringToTrim.replace(/\s+$/,""); }
function ltrim(str) {
for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
return str.substring(k, str.length);
}
function rtrim(str) {
for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
return str.substring(0,j+1);
}
function trim(str) {
return ltrim(rtrim(str));
}
function isWhitespace(charToCheck) {
var whitespaceChars = " \t\n\r\f";
return (whitespaceChars.indexOf(charToCheck) != -1);
}