iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • I love the code... dot com
    123,715

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Opening a REMOTE WINDOW in Javascript

    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="javascript: 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)


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article:
    Next Article: Opening an Alert Box in Javascript





    CSSCSS

    David McFarland

    New $23.09

    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.85

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $23.99

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39

    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39


    Of Interest:
  • Create an Array of Specific Numbers in Perl
  • What Environmental Variables are Available
  • Exit a Script or Subroutine in Perl
  • Exit a Loop with Last
  • Use OnMouseOver in Javascript
  • Match with a Regular Expression, REGEX, in Javascript
  • Javascript Bold Text
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • HTML Background
  • HTML Color Chart
  • Make a New Paragraph Using HTML
  • HTML Center

  • More Articles:
  • Create an Array of Specific Numbers in Perl
  • And, Or, Equal, Not Equal, Greater Than, Less Than in Perl
  • Matching at the Beginning and End
  • Add to End of an Array with Push in Perl
  • onClick Javascript
  • Change a Form Field with Javascript
  • Call your Function in Javascript
  • Annoy Users with onBlur in Javascript
  • Use OnMouseOver in Javascript
  • HTML Codes
  • Make a New Paragraph Using HTML
  • HTML Body Tag
  • HTML Tables

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    420,476
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:16 EDT