Forum Moderators: open
The instructions are written in the form:
document.write([an anchor link from an array in the agent file]);
The array element in the agent file would be of the form:
"<a href = 'http://www.example.com/'>http://www.example.com/</a>"
This works fine. When the link is clicked on, the URL specified opens up in the frame. However, what I want to do is to have the instruction so that the URL opens up in a new window, and leaves the frame window unchanged.
I can open up the URL in a new window by changing the array element to the form:
"<a href = 'javascript:window.open(\"http://www.example.com/");'>http://www.example.com/</a>"
(This is using an escape char \")
This opens the URL in a new window when clicked but it replaces the content of the frame with:
"[object Window]"
What can I do to keep the URL in the frame unchanged when the new window is opened?
peter
[edited by: tedster at 2:50 pm (utc) on Sep. 24, 2003]
Use a real href so SEs see it.
Use the
this object to refer to the value of href in the window.open() method. return false to cancel the propigation of the event so that the browser doesn't try to load href in the calling window. HTH
Jordan