![]() |
Help with some .js code
How do I make this open in the same window instead of a new one ?
GoTo = new Array(); GoTo[0]= 'http://www.some url.com'; |
location.href = GoTo[0];
|
I changed it to location.href = GoTo[0]; but it goes to the
page without being clicked on ? |
Put the code into a function:
function name_it_what_ya_want( ) { GoTo = new Array(); GoTo[0]= 'http://www.some url.com'; location.href = GoTo[0]; } Make an anchor to use the function: <a href="javascript:name_it_what_ya_want()">now it goes to some url</a> |
I assume the GoTo array is a list of URL's you are processing and [0] could be a variable number within the array count?
|
When I add this it automatically goes to the new page without being clicked ?
|
spunkmaster, as mikeyddd said, put in in a function and execute it from the href or onclick event...
|
All times are GMT -7. The time now is 12:55 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123