User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 455,975 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,758 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 4090 | Replies: 3
Reply
Join Date: Nov 2007
Posts: 19
Reputation: smilyswapna10 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
smilyswapna10 smilyswapna10 is offline Offline
Newbie Poster

Re: open links in parent window (from child)?

  #1  
Nov 29th, 2007
how to disable the parent window when we open the child window. i have written this code but its working only one time.any one can help me

s.html


<html>
<head>
<SCRIPT >
function popuponclick()
{
my_window = window.open("p.html",
"mySelect", "status=1,width=750,height=450,resizable=no");
}

</script>
</head>
<body>
<form name="formSelect">
<P>
<A HREF="#" onclick='popuponclick()' >show popup window</A><br>
</P>
</div>
</form>
</body>
</html>

p.html

<html>
<head>
<script language = javascript>
</script>
</head>
<body onBlur="self.focus()">
bbb

</body>
</html>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Location: Russia
Posts: 11
Reputation: adorosh is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
adorosh adorosh is offline Offline
Newbie Poster

Re: disable parent window

  #2  
Dec 6th, 2007
what do you mean by disable parent window? do you want to close it?
If so, forget about it - JavaScript able to close windows that open by JS only.
Reply With Quote  
Join Date: Dec 2007
Posts: 75
Reputation: hielo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
hielo hielo is offline Offline
Junior Poster in Training

Re: disable parent window

  #3  
Dec 8th, 2007
Try these instead:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hielo's Parent Page</title>
</head>
<body>
<script type="text/javascript">
var child_window=null;
var parent_window=window;
function popUponClick()
{
child_window = window.open("p.html", "mySelect", "status=1,width=750,height=450,resizable=no");
parent_window.onclick = blurify;
parent_window.onfocus = blurify;
return false;
}
function blurify()
{

if(child_window)
{
if(parent_window)
parent_window.blur();
child_window.focus();
}
}

</script>

<form name="formSelect">
<p><a href="#" onclick='return popUponClick();'>show popup window</a><br /></p>
</div>
</form>
</body>
</html>


========================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hielo's Child Page</title>
<script type="text/javascript"><!--
var parent_window = window.opener;
var child_window = window.self;
function closeIt()
{
if(parent_window)
{
if(window.ActiveXObject)
{
child_window.blur();
parent_window.focus();
}
parent_window.close();
child_window.focus();
parent_window=null;
}
}
//--></script>
</head>
<body>
<form action="." method="POST">
<input type="button" value="Close Parent" onclick="closeIt();"/><input type="button" value="Close Me" onclick="self.close();"/>
</form>
</body>
</html>
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,009
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 368
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: disable parent window

  #4  
Dec 9th, 2007
It has already been solved.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC