How do I open a window from within a .js file? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How do I open a window from within a .js file?

How do I open a window from within a .js file?

I want to do this, below in a .js file like I would in a html file.


Comments

  • mac_doggiemac_doggie Posts: 488Member
    In a js file you write javascript not html, so I'd say you'd do something like this:

    myhtml.html
    [code]


    sometitle




    method 1
    method 2



    [/code]

    myjsfile.js
    [code]
    var win = null;
    function MyFunction(url,method) {
    alert("this is method "+method);
    win = window.open(url,"popupwindow","scrollbars=1,status=1");
    }
    [/code]

    see http://www.w3schools.com/jsref/met_win_open.asp for a detailed description of the window.open function
    ;-)
    -mac-
    mailto:[email protected]
    the Netherlands...
  • mac_doggiemac_doggie Posts: 488Member
    This post has been deleted.
Sign In or Register to comment.