JavaScript URL Redirects

File: urlredirect.js

function redirectUrl(url)
{

    var result =[
        {‘test.aspx’ : ‘http://www.google.com’},

    ];

    $.each(result, function(k, v) {
        for(var prop in v){
            if(v.hasOwnProperty(prop)){
           
                //alert(prop + ‘ is ‘ + v[prop]);
               
                if (url.toLowerCase().indexOf(prop.toLowerCase()) > -1) {
                    //alert(‘redirect to ‘ + v[prop]);
                    window.location.href = v[prop];
                }
            }
        }

    });
}

image