Please Help!!! Browser window

C

Charl

Hi All,

I am opening a new window on my website using an menu which reads from
a js file, but when it opens the new window the previous page just
displays [object]

I am using this:

addItem('<img src="/images/template/charter.jpg"
border="0">',HREF="javascript:window.open('http://www.cnn.com','blank','');",
'', null, 148);

Please let me know if I should supply more code.

Thanks
 
T

Touffy

I am opening a new window on my website using an menu which reads from
a js file, but when it opens the new window the previous page just
displays [object]

I am using this:

addItem('<img src="/images/template/charter.jpg"
border="0">',HREF="javascript:window.open('http://www.cnn.com','blank','');",
'', null, 148);

The javascript: protocol loads the result of the expression into the
current window. That's what it's supposed to do and is not a bug.

window.open() returns a window object, so that is what is displayed.
Please let me know if I should supply more code.

you should even consider not using the code you are using (the addItem
method looks absolutely horrible even without actually seeing the code)
but if you want a quick fix, this will do:

To prevent the expression from returning a value, insert the void
operator at the beginning of the expression:

"javascript:void(window.open('http://www.cnn.com','blank',''));"
 
C

Charl

Thank you very much that worked :)

I am opening a new window on my website using an menu which reads from
a js file, but when it opens the new window the previous page just
displays [object]

I am using this:

addItem('<img src="/images/template/charter.jpg"
border="0">',HREF="javascript:window.open('http://www.cnn.com','blank','');",
'', null, 148);

The javascript: protocol loads the result of the expression into the
current window. That's what it's supposed to do and is not a bug.

window.open() returns a window object, so that is what is displayed.
Please let me know if I should supply more code.

you should even consider not using the code you are using (the addItem
method looks absolutely horrible even without actually seeing the code)
but if you want a quick fix, this will do:

To prevent the expression from returning a value, insert the void
operator at the beginning of the expression:

"javascript:void(window.open('http://www.cnn.com','blank',''));"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top