Opening a small (or child ) window from a main ( or parent ) window

Parent and child window We can open a small window known as child window by clicking a button or a link or a image of a main window. We can control the width, height and location ( alignment from top left corner of the screen ) of the small window from the main window.
Opening closing & Passing data from Child window to parent window in JavaScript & refreshing main

Here we can control the status bar, tool bar and resize the child window from the main window. By changing the value of status to 1 form 0 (status=1;) we can display the status bar for the child window. Same way by making the toolbar=1; we can display the tool bars for the small window. We can change the value of left to position the window horizontally. If we make the value of left to 0 like left=0; to align the window to left edge of the screen. Same way by making the top=0; we can place the window at the top of the screen. Don't forget to refresh the parent window every time you change the parameters. Here is the code at the parent window to display the link. Click the demo link to see how the window opens.

Click here to open the child window

Here is the code of the above link
<a href="javascript:void(0);" NAME="Error Handling"
  title="ZeroDivisionError handling""window-child.html","Ratting","width=550,height=170,left=150,top=200,toolbar=0,status=0,");>Click here to open the child window</a>
Here is a button to open the same window

Here is the code of this button
<input type=button"window-child.html","Ratting","width=550,
height=170,left=150,top=200,toolbar=0,status=0,"); value="Open Window">
Take care of line break in above code.( Remove )
JQuery Manaing Parent & Child window
Pass the data betweeen parent and child window and refreshing part of the parent window once Data is changed at child window.

Scrollbar on child window

We can add scroll bar to child window by adding scrollbars=1 while opening the window. Here is the modified code.
<a href="javascript:void(0);"
NAME="My Window Name" title=" My title here ""window-child.html","Ratting","width=550,height=170,0,status=0,scrollbars=1");>Click here to open the child window</a>
Click here to open the child window


Window object Reference Window close Passing data from Child window to parent window Passing data from Parent to Child Window

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net



    thank you:friend:)how to pass the value from child window to parent window


    Thank you! This helped me so much
    bhushan wagh


    Thanks a lot,it's really cool exam.


    Thank you. It helped me a lot.


    You just saved me hours of time.


    How to open sub window in the same page without new browser tag


    You can hide or display a layer by managing through css


    Can I do this with desktop app?


    How ca we open a desktop app in a child window of another desktop app?


    FRom the desktop add you can click the link with URL to open browser with the specified url. It depends on the app you are using.

    Post your comments , suggestion , error , requirements etc here

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer