View Full Version : Javascript window.open within Frameset

06-18-2009, 04:39 PM
I have the following code that works fine within an asp file but failes if the file is within a frameset...

<script language="JavaScript">

function open_new_window(url)
new_window = void window.open(url,'displayWindow',"width=500,height=500,left=10,top=10");
<td width="17%"><font size="-1"><b>Circuit: <a href="javascript:open_new_window('feederinfo.asp?fdr=<%=(feeder)%>')" style="text-decoration: none"><%=feeder%></a></b></font></td>

When using the page within the frameset, the error returned is "Object expected" for the frame document file. Been searching the web for hours with no luck. Any help/suggestions would be appreciated.

07-01-2009, 02:40 PM

top.window.open instead.
The problem occurs because you try to call it from within a frame.


Old Pedant
07-02-2009, 01:10 AM

new_window = void window.open(url,'displayWindow',"width=500,height=500,left=10,top=10");

(1) What's the void in there for???
(2) Why do you bother assigning it to the variiable new_window??

But, yes, you indeed do need to use top.window.open or parent.window.open if you are trying to create a popup.