iLTC Home
Bookmark iLTC!

Categories

Perl
  • Perl Tutorials Beginners

  • Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

  • HTML
  • HTML Tutorials

  • Command Line
  • Command Line Tutorials

  • How Tos
  • Other Tips and Tricks



  • <script type='text/javascript'>
    1727899

    iLoveTheCode.com

    Opening a REMOTE WINDOW in Javascript

    window.open is a built in Javascript method. It opens a new window.

    You define the new window, with arguments, inside parenthesis.

    window.open('http://google.com', 'chrisnewwindow', 'width=400, height=400, left=8, top=40, menubar=0, toolbar=0, scrollbars=1, location=0, directories=0, resizable=1, status=0');

    Inside the first single quotes, you type the URL you want to appear in the new window.

    Inside the second set of quotes, you name the window whatever you like.

    Inside the third set of quotes you set different features you want the window to have.


    Copy and Paste Javascript (two ways to use):

    In a link:

    <a href="#" onClick="window.open('http://google.com', 'chrisnewwindow1', 'width=400, height=400, left=48, top=80, menubar=0, toolbar=0, scrollbars=1, location=0, directories=0, resizable=1, status=0');return false">Google In New Window</a>

    In a script:

    <script type=text/javascript>
    <!--
    window.open('http://google.com', 'chrisnewwindow2', 'width=400, height=400, left=28, top=60, menubar=0, toolbar=0, scrollbars=1, location=0, directories=0, resizable=1, status=0');
    -->
    </script>


    When using in a link, the return false means don't load the link that is being clicked on. Just do the javascript.


    Note: Some of the window features are browser dependent. You'll get different results on Safari for Mac, Internet Explorer for Windows, or Firefox on either.

    Just for Fun Info: I believe my old Netscape browser used to use yes and no instead of 1 or 0. There was an x and y too. Ah, when Netscape 2 ruled the browser world. Pardon my digression as I wipe the tears from mine eye.



    Opening a Remote Window - See in Action (new window)




    Previous Article:
    Next Article: Opening an Alert Box in Javascript






    Search iLTC w/ Google




    Recent Articles

  • HTML Font Code
  • Javascript and CSS - Easy Pop Up Help Balloons
  • Use OnMouseOver in Javascript
  • Use onMouseOut in Javascript
  • Use innerHTML to Change Text on a Page
  • Renaming a File with Perl's RENAME Function
  • PRINT to Browser with document.write Command in Javascript
  • Passing an Argument or Variable to a Javascript
  • Opening an Alert Box in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • OPEN and WRITE a Data File in Perl
  • OPEN and READ a Data File in Perl
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Javascript Reset Form








  • Perl Programming - Javascript Programming - HTML Code - Mac Unix Command Line - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006-2009 iLoveTheCode.com


    Contact Chris | About this Site


    1727624
    Counter by iLoveTheCode.com


    Last Modified: Monday, 09-Feb-2009 03:16:12 EST



    Hosted as well :)
    Home-brewed logo - 1997