View Full Version : how to redirect with js?

12-08-2010, 11:02 AM
Hi, I'm trying to redirect my users to their profile, but can't figure out how to put the function into the link. sethighlightedValue(); is a function that returns the users username. Is there anyway else to do this?

Here's what I got:

case RETURN:

window.location = "profile.php?user='setHighlightedValue();'";
bubble = false;

Philip M
12-08-2010, 11:44 AM
var un = "Philip"; // returned user name
var newLoc = "profile.php?user=" + un;
window.location = newLoc;

Note that anything after the window.location statement will not be executed.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.