PDA

View Full Version : Using JS in VBA Template to redirect URL


m002.p
12-13-2009, 07:20 PM
Hi everyone,

I am trying to use this code in a template relating to vbadvanced, and for some reason it doesnt work.

I want to hide a URL in the status bar by using a JS redirect. I need to use this as the URL displays a password for security reasons I do not want revealed.

This is what I have been using in the template:

<head>
<script language="javascript" type="text/javascript">
function redirect(URL)
{
document.location=URL;
return false;
}
</script>
</head>

Then this link is where the JS function is called upon further down the template:

<a href="xfire:join?game=$game&server=$ip" onclick="return
redirect('xfire:join?game=$game&server=$ip&password=$pass');">Xfire Join Server</a>

For some reason, the above link still shows and directs to the href="" URL and not the redirect URL as issued to the JS function.

Any ideas why it isnt working or can you supply an alternative redirect to make the similar effect?

Thanks in advance

kh99
12-13-2009, 07:45 PM
I tried it and that works for me, it redirects to the url you pass in your redirect call. I didn't use exactly the same urls of course.

Just to make sure you know, I don't think that will stop someone from viewing the page source and seeing the password.