Javascript

Javascript check for IE

25 Mar , 2012  

function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}
function checkVersion(ver_req) {
    var msg = "You're not using Windows Internet Explorer.";
    var returnvalue = false;
    var ver = getInternetExplorerVersion();
    if (ver > -1) {
        if (ver <= ver_req)
            return true;
        else
            return false;
    }
    return msg;
}
if checkVersion(8.0)
{
    window.onload = function(){addCorners("rnd");} /* Change "rnd" to the
name of your class */
}

Javascript

Jquery tips and tricks

26 Nov , 2011  

I recently found a very good article of some useful jquery tips and tricks here it is:

http://www.opensourcehunter.com/2010/02/27/26-cool-and-usefull-jquery-tips-tricks-solutions/

Javascript

Redirect page through javascript

24 Jun , 2011  

Simple Redirect Page

<script type="text/javascript">
   <!-- window.location = "http://www.google.com/" //-->
</script>

Time Delayed Redirect

<html>
<head>
<script type="text/javascript">
   <!-- function delayer(){
      window.location = "../javascriptredirect.php"
   } //-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">
   <h2>Prepare to be redirected!</h2>
   <p>This page is a time delay redirect, Hang on while we redirect to another page.</p>
   </body>
</html>