Click to See Complete Forum and Search --> : change target in this script??


mitya
10-01-2003, 06:09 AM
Hi all

How would I make the following open in a given target (e.g. _blank)?

function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

Cheers.

pyro
10-01-2003, 07:37 AM
Hmm... I'd wonder if there is a better way of doing whatever it is you need to do. Dreamweaver doesn't generate the prettiest code. Maybe if you explain someone can give you something better. Anyway, try:

function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) window.open(args[i+1]);
}

mitya
10-01-2003, 11:14 AM
Cheers for that, it'll do the trick.

I'm aware Dreamweaver's methods are probably for the dummy java coders but hey, that's me. Don't know java, just PHP/AS. DW doesn't even get HTML right some times.

Cheers for the help.

pyro
10-01-2003, 12:46 PM
You bet... :)