473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Call javascript in parent from child (pop up) window

I have some javascript that works in Firefox 2 but not in IE 7. In the
parent page, a user clicks a link and a new window is opened so that
they can maintain some values. When the user is finished, they can
click either a save or a cancel button. If the user clicks the save
button, I want the parent page to be refreshed and then the child
window to close. I have this working perfectly in FF2 but it does not
in IE. In IE, the parent page is refreshed but when it refreshes, the
screen that comes back is the same screen as the child window. When
the child window should close, it instead is being refreshed and comes
back as a blank screen.

Does anybody have any ideas as to how I can make this work in IE 7?
>From the parent page, here is the hyperlink that opens the popup
window:
<a href="#" onClick="clickAdvEdit('someData');>Advanced Edit...</a>

and funciton clickAdvEdit ultimately does this:
var lUrl = /somepage/index.html
var opt =
"toolbar=0,location=0,directories=0,status=0,menub ar=0,scrollbars=1,resizable=1,width="
+ screen.availWidth + ",height=" + screen.availHeight;
window.open(lUrl ,"", opt, false);
>From the save button of the child page:
<button type="button" class="primary"
onClick="showChanges();">Save</button>

and the function showChanges is defined as this:
function showChanges() {
if (typeof window.opener.ctgMaintClick=="function") {
window.opener.ctgMaintClick();
window.close();
}
}

Any ideas or suggestions would be appreciated.

Pete

Jan 12 '07 #1
1 11400
ASM
ace danger a écrit :
>
>>From the parent page, here is the hyperlink that opens the popup
window:
<a href="#" onClick="clickAdvEdit('someData');>Advanced Edit...</a>

and funciton clickAdvEdit ultimately does this:
var lUrl = /somepage/index.html
var opt =
"toolbar=0,location=0,directories=0,status=0,menub ar=0,scrollbars=1,resizable=1,width="
+ screen.availWidth + ",height=" + screen.availHeight;
window.open(lUrl ,"", opt, false);
truc = window.open(lUrl ,"", opt);
>>From the save button of the child page:
<button type="button" class="primary"
onClick="showChanges();">Save</button>
onclick="opener.ctgMaintClick();">Save< ...
and the function showChanges is defined as this:
and now we only use function ctgMaintClick() declared in file displayed
in mother window (this you call 'parent')

function ctgMaintClick() {
// all expected job except to submit the form
truc.close();
document.theForm.submit();
}
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: J P Singh | last post by:
Hi Guys Wonder if someone can help me with this. I have a form where a user clicks a button which gives them a pop up windows to allow them to add the data. The user adds the data and click...
1
by: gopal srinivasan | last post by:
I need to know how to close a parent modal window when child modal window opens, also i need to know the syntax for writing document on the modal window on the fly, like what we do in case of...
1
by: Tomas Vera | last post by:
Hello All, I'm working on a web app that will simulate a Windows app. One of the items that I've trouble reproducing is the parent/child interaction that might occur between a windo and popup...
1
by: Jason Huang | last post by:
Hi, I want to create a Web form in asp.net, using C#. So in a web page, we have one DropDown List or one DataGrid, that when we click an item from a dropdown list, there will pop up another web...
1
by: Nevyn Twyll | last post by:
I have a DataList; in the DataList's , I have a LinkButton and a few listboxes. When the LinkButton is pressed, I need to get the ID of the selected item in one of the Listbox controls. Then I...
2
by: Jason Wilson | last post by:
I am trying to create a popup window that will give a user the option to lookup a value and return it to a textbox on the parent page. Here is my relevant code: Code on Parent <form...
1
by: praveenit | last post by:
hi, I am writing a small java script code where , when the textbox is clicked a pop up window is opened . on entering some data in the text area present in pop up window and pressing ''save"...
11
by: manstey | last post by:
Hi, I am having trouble designing my classes. I have two classes. The first one wraps around an old-style class called oref Class CacheClass(object): def __init__(self, obj):
3
by: Jimmy | last post by:
It is also possible for popup window to call function in main window by using the opener property. Will "opener.someFunctionInMain(param1, param2)" in the popup window work? It's possible for...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.