How to close a child window from a parent window using javascript

This Tutorial Has Been Viewed 4,651 Times.

Here i will explain how to close a child window from a parent window using simple javascript.


<title>Example For Child and Parent Window Operations</title>
<script language="JavaScript">
function closeDep()
{ //mistonline.in //refer us for more tutorials scripts
if (main && !main.closed) main.close()
else{ alert("I think you have not open any child windows")
}
}
</script>
<body>
<div> <a href="http://www.mistonline.in/" onclick="main = window.open(this.href, 'win', 'height=650,width=700'); return false">
Mistonline tutorial world</a></div><p><input type="button" value="winclose" onClick="closeDep();"/>

Simple correct.Please give some feedback.

DEMO


VN:F [1.9.13_1145]
Rating: 6.5/10 (2 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

How to close a child window from a parent window using javascript, 6.5 out of 10 based on 2 ratings

Incoming search terms:





You will also be interested in ,

3 Responses

  1. Anirban says:

    Excellent, Superb

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  2. john says:

    Interesting post :) Bookmarked it!

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  3. john says:

    Love your blog I’m going to subscribe

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

Leave a Reply

Spam protection by WP Captcha-Free

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks
More in DOM, Html, JavaScripts (82 of 91 articles)


Here i will explain how to add and remove child nodes in a webpage using simple javascript and DOM [Document ...