pop ups

They have: 2 posts

Joined: Mar 2003

I have done a site that links to another site in the form of a pop-up (the reason i have done it like that is because the page i link to wont open in frames) now i have realised i need to link to several pages on the same site. As i dont want a new window opening everytime (hell that would be very annoying lol) i was wondering if there was anyway i could put on my main page some html or possibly javascript that would force it to open in the same window. I would like the information to change every 5 minutes. Any help or suggestions would be gratefully accepted.

He has: 1,016 posts

Joined: May 2002

I'm guessing you're using JavaScript to open the popups? All you need to do is to use the same windowname and they will all open in the same window. Here's an example...

window.open('http://www.domain.com/subdir/', 'myNewWindow', 'width=600,height=400, resizable=1');

The "myNewWindow" part is where you give the window target name. The 2nd time a user clicks on a link, if a window with the name "myNewWindow" (or whatever...) is already open, then no new windows will open (the page will load in the already open window).

They have: 2 posts

Joined: Mar 2003

thankyou zollet

now could i do that automatically for example say i wanted to rotate three url's in the same window at a set time period is there some refresh command or similar i could use?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

you could set a refresh in that window, or use a random javascript script to display a different image each time. Image rotation script or random image script (one goes in order, the other is, well, random), and you can set both to a timer.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.