2

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')");

5 Answers 5

4

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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

Comments

0

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

Comments

0

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

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.