![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jan 2004
Posts: 2,052
|
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'; |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jun 2004
Posts: 689
|
location.href = GoTo[0];
__________________
Webmasters! Looking for new affiliate programs to promote? Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ... |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jan 2004
Posts: 2,052
|
I changed it to location.href = GoTo[0]; but it goes to the
page without being clicked on ? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Viva la vulva!
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
|
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>
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Viva la vulva!
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
|
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?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Jan 2004
Posts: 2,052
|
When I add this it automatically goes to the new page without being clicked ?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Jun 2004
Posts: 689
|
spunkmaster, as mikeyddd said, put in in a function and execute it from the href or onclick event...
__________________
Webmasters! Looking for new affiliate programs to promote? Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ... |
![]() |
![]() ![]() ![]() ![]() ![]() |