How to open new browser window using javascript?

前端 未结 5 1185
抹茶落季
抹茶落季 2020-12-18 14:10

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 pa

相关标签:
5条回答
  • 2020-12-18 14:38

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

    0 讨论(0)
  • 2020-12-18 14:40

    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

    0 讨论(0)
  • 2020-12-18 14:58

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

    0 讨论(0)
  • 2020-12-18 14:59

    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.

    0 讨论(0)
  • 2020-12-18 15:02

    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.

    0 讨论(0)
提交回复
热议问题