tags:

views:

49

answers:

6

I need to open new browser window using java script window.open, i have html page but it getting error as page not found.This is from jsf/icefaces.I have display the html page directly.Please help me...

    JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(),
"window.open('printerFriendly.html','Print',,'width=300','height=200','menubar=yes',
'status=yes','location=yes','toolbar=yes','scrollbars=yes')");
A: 

have you tried writing the complete url for the new html page?

aniri
A: 

window.open opens new browser window. If you getting page not found error, may be you should check that the page exists?

Alex Reitbort
A: 

Your JavaScript is correct, you need to correct the URL ('printerFriendly.html').

Reinis I.
A: 

Try something like this:

<FORM>
<INPUT type="button" value="New Window!" onClick="window.open('http://stackoverflow.com','mywindow','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes')">
</FORM> 

It's in a form, but the JS code would be the same for any other link.

Marcin Cylke
A: 

Opening a New Window With JavaScript

http://www.pageresource.com/jscript/jwinopen.htm

Javascript (JS) Tutorial - opening new browser window using open ...

http://www.hscripts.com/tutorials/javascript/open-method.php

ratty
A: 

Page Not Found is Page Not Found. Check if the URL is correct. Is printerFriendly.html located in the same folder as your current page? It should be. Or you should provide the correct path.

Strelok