Discussion Locked

Need expert HTML or JavaScript help

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Greetings, folks. I'm tweaking my website, and I've come up against a problem I've never encountered before. I have a pop-up window that loads with my main page (an HTML page opened with a small Javascript). I have embedded a couple of links within that pop-up, but I want to cause the hyperlink to direct the original browser window to the target page (preferred), or to open a new browser window with the target page (acceptable). This is beyond my realm of experience, and I can't find any answers on how to do this in my ref manuals or online help. Suggestions?

Thanks......

2 replies

by shanghai sam

I think this will do what you are looking for. This is running on IIS 4.0 on NT4 server. Copy each of the sections into files on the web server. Put them all in the same web directory. When you open the main.asp, it should open main in a normal browser window and then a popup window with pop.asp should show up. Click on the ‘next’ link in the popup window and the main window should change pages to next.asp. All you need to do is add more links to the popup page. Hope this works for you.

//////// main.asp ///////////

<%@ Language=JavaScript %>

Main page

//////////////////////////////////

/////////// pop.asp /////////////
<%@ Language=JavaScript %>

next.asp
Popup page

///////////////////////////////

////////// next.asp ///////

Next page

/////////////////////

by ebob

Note to the Governor:

You can also just drop these in as *.HTML pages, dropping the opening "<%@ Language=JavaScript %>" tags.

What Aaron is demonstrating is that "pop.html" knows what window (or instance of the browser, or...) opened it. Andit keeps a referrer that you can get at. That referrer is the opener() object of the window() object. Specifically, this sample refers to the location property. Used as demonstrated, it's analogous with "target=" as you've probably seen when using frames.

So "pop.*" just says: Hey, the window that opened me should now load the file "next.asp", or "next.htm", if you've renamed them.

This discussion is closed to new replies.