This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes window.open problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "window.open problem" Watch "window.open problem" New topic
Author

window.open problem

Gayatri Ganesh
Ranch Hand

Joined: Dec 23, 2003
Posts: 143
Hi,

I have
a href='' on click='callfn'

in the callfn
i call window.open ,with _blank ie open in new window, based on some conditions.
It calls window.open correctly but it also puts the contents which are in this new window on the parent window which I dont want.
i.e it is opening new window with correct contents but also
submitting to the main window.

Would appreciate any inputs on how to get rid of the contents on parent window.

Thanks,
Gayatri
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
onclick="fnc();return false;"

Eric
Gayatri Ganesh
Ranch Hand

Joined: Dec 23, 2003
Posts: 143
Thanks that works.
But I don't understand why I need to return false after the call.
Thanks,
Gayatri
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
because the link is doing its default behavior. If you return false, it cancels it from executing.

Eric
Gayatri Ganesh
Ranch Hand

Joined: Dec 23, 2003
Posts: 143
thanks Eric
 
Don't get me started about those stupid light bulbs.
 
subject: window.open problem