This script is typically full of bugs due to the difference in the way Javascript is being processed in Internet Explorer or Firefox. Fundamentally, the difference is in the way Internet explorer does chaining (its more intelligent) as compared to that of Firefox. But then again, Firefox forces you to write good codes. What normally works in Firefox will work in Internet Explorer, but not neccessarily the other way round.
Anyhow, the codes for the parent window is as follows:
<script type="text/javascript">
<!--
// What these codes does it open up a popup when you click on something and when we receive a signal from the child, we updateLayer
function openBrWindow(theURL,winName,features) {
(theURL,winName,features);
}
function updateLayer() {
var obj = document.getElementById('selectcat1');
obj.innerHTML = "Testing"; // I had to do it this way else Firefox won't accept it!
}
//-->
</script>
You can open a new window with the following:
<a onclick="openBrWindow('selectcat.php','selectcat1','location=0,scrollbars=1,width=700,height=300')" href="#">popup</a>
The thing to update in parent is a SPAN Tag:
<span id="selectcat1" class="greyFont">None</span>
The codes for the child popup window is:
<script type="text/javascript">
<!-- function updateParentCloseSelf() {
opener.updateLayer();
self.close();
}
//-->
</script>
The button within the child is:
<input onclick="javascript:updateParentCloseSelf();" border="0" value="Submit Query" type="submit" name="Submit">
Saturday, April 4, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment