I am trying to create an SOS page in which i am changing the links on the page after the button click. My problem here is that the links get changed but they get appended to the current pages URL.
My links do contain http:// (My reputation is less than 10 here)
Eg.
Originall link -- "htp://xyz.com?login_type=encrypted&login=&password="
Required link -- "htp://xyz.com?login_type=encrypted&loginxxx=&password=yyy"
Actual link that I am getting -- "htp://currentpageURL.com"htp://xyz.com?login_type=encrypted&login=&password=""
Here is the js I am using
function handleClick()
{
var uid, pwd;
uid = $("#uid").val();
pwd = $("#pwd").val();
if(uid != "" && pwd != "")
{
$("#links").show();
$("#login").hide();
$('a').each(function () {
var href = $(this).attr("href");
$(this).attr("href", href.replace("login=", "login=" + uid).replace("password=", "password=" + pwd));
});
}
else { alert("Please enter valid credentials"); }
}