Closed
Bug 397512
Opened 17 years ago
Closed 16 years ago
Clicking back after destroying an iFrame does nothing.
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 293417
People
(Reporter: mike.elmore, Unassigned)
Details
Attachments
(1 file)
(deleted),
application/octet-stream
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
I am working on a project where the users will click a link to pop a search page where they can enter certain criteria and get results. This pop up is an iFrame that I am dynamically creating, and when they are done with it, it gets destroyed. The problem I run into when when doing this is that when the users click the back button, it does not respond. If they use the drop down list next to the back button and pick a page in the history, they are unable to go forward past the page as well.
Reproducible: Always
Steps to Reproduce:
See the Additional Information field for all the files I am using. Copy the contents into a file and save it. There are 4 files, Base.html, Frame1.html, Frame2.html, iFrames.js
1. Open Base.html
2. Click the button to create the iFrame and load the page Frame1.html
3. Click the submit button or click the link on the iFrame to go to Frame2.HTML
4. Click the close button to destroy the iFrame
5. Click the browser's back button.
Actual Results:
When the back button is clicked, nothing happens.
Expected Results:
I expected the browser to go back in the iFrame. If you skip the step where you destroy the iFrame and click the back button, it works fine and goes back normally. However, since the iFrame no longer exists there is no iFrame to go back in.
The following is the contents of the files I am using.
Contents of Base.HTML:
<script language='javascript' src='iFrames.js'></script>
<a href="javascript:Search();">Create iFrame</a>
<script language='javascript'>
function Search(){ CreatePopupFrame('Frame1.html',800);}
</script>
---
Contents of Frame1.html
<button type='Button' class='Base-Button ' onclick="javascript:parent.DestroyIframe('PopupFrame');">Close Window</button>
<a href='Frame2.html'>Frame2.html</a>
<form action='Frame2.html'>
<input type=submit>
</form>
---
Contents of Frame2.html
<button type='Button' class='Base-Button ' onclick="javascript:parent.DestroyIframe('PopupFrame');">Close Window</button>
---
Contents of iFrames.js
//iFrame positioning & setting JavaScripts
//Created by Michael Elmore 2007-09-18
//Copyright Avion Inc. 2007
var myTimer;
var url;
var DictionaryFrameWidth = 300;
var object;
//Create the iFrame for popups
function CreatePopupFrame(url,Width){
var StyleLeft = ((PageWidth()-Width)/2);
var iFrame = document.createElement('iframe');
DestroyIframe('PopupFrame');
iFrame.id = 'PopupFrame';
iFrame.name = 'PopupFrame';
iFrame.src = url;
iFrame.style.width = Width;
iFrame.style.left = StyleLeft;
iFrame.style.position = 'Absolute';
document.body.appendChild(iFrame);
}
//Create the iFrame for data dictionary popups
function CreateDictionaryFrame(url,Width,obj){
var coors = findPos(obj);
var iFrame = document.createElement('iframe');
iFrame.id = 'DictionaryFrame';
iFrame.name = 'DictionaryFrame';
iFrame.src = url;
iFrame.frameborder = '0';
iFrame.style.height = 0;
iFrame.style.width = Width;
iFrame.style.top = (coors[1]+(obj.style.height || obj.height));
if (coors[0] > (PageWidth()/2)) {
iFrame.style.left = (coors[0]-Width); //Subtract the width of the frame so it appears to the left
} else {
iFrame.style.left = (coors[0]+(obj.style.width || obj.width)) + 'px'; //Add the width of the obj so it appears to the right
}
iFrame.style.position = 'Absolute';
document.body.appendChild(iFrame);
}
//Destroy the iFrame if it has been created.
function DestroyIframe(iFrameName){
if (document.getElementById(iFrameName)) {
document.body.removeChild(document.getElementById(iFrameName));
}
}
//This function creates the data dictionary popup with a timeout so it doesn't pop immediately.
function DictionaryMouseOver(TableName,FieldName,obj){
//url and object must both be global variables in order to be accessable by the function inside a setTimeout function.
url = '/'+AppRootDir+'/Misc/DataDictionary.aspx?TableName='+TableName+'&FieldName='+FieldName+'&TableOnly=True';
object = obj;
myTimer=setTimeout('CreateDictionaryFrame(url, 300, object);', 200);
}
//Clear the timeout and destroy the dictionary iFrame
function DictionaryMouseOut(){
clearTimeout(myTimer);
DestroyIframe('DictionaryFrame');
}
//Function that finds the position of the object passed in.
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
//Window size and position finding functions.
function PageWidth() {
return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth);
}
function PageHeight() {
return (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight);
}
function PosLeft() {
return (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft);
}
function posRight() {
return PosLeft()+PageWidth();
}
function posTop() {
return (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
}
function posBottom() {
return PosTop()+PageHeight();
}
These are the files described in the bug report. I didn't know there was an attachment option when I submitted it.
Updated•16 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•