Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close or "Back" Button in IE or FireFox

Status
Not open for further replies.

whill1

Technical User
Feb 14, 2004
46
US
Hi,
I have a weppage that when a function is called, the function uses document.write(s) to write a table. The table opens to what appears to be a new page. I created a close button for this page with ...onClick'back()'>. this works beautifully in FireFox (closes the table window and returns to the previous page, which is the page from whare the function() is called)however, it does not work in IE. I tried ...onClick'self.close()'> and other variations of the close function. When I get it to work at all, it closes both pages and the browser.

Discription:
1)first page- 1 line of text, a textbox, a button (Calculate). User enters a number into textbox, clicks button, a plain white page displays the table with calculations in it. I want to close this page or go back to the one with the textbox and "Calculate" button.
As I mentioned ...onClick'back()'> works perfect in FireFox but I am looking for a solution that will work in at least FF and IE.
Thanks to all who may have suggestions.
whill1
 
The page is created with the document.write() statements. not sure how this works but here is the part of the code that creates it. code in red is the code for the button and it works in FireFox but not in IE.
Code:
document.write('<html><head><title>Powers Writer</title><center><h1>Calculated Powers!</h1></center></head><body bgcolor="FFFF99" text="990000">');


[COLOR=red] document.write('<input type="button"' + 'align="middle"' + 
'value="Close"' + "onclick='back()'>"); [/color]


	document.write('<table width=60%');
	document.write(' bordercolor= "#990000" + ');
	document.write(' align=center border=1 cellpadding=1 cellspacing=1>');
	document.write('<th>Integer</th><th>Square</th><th>Cube</th><th>Quad</th>');
	for ( i = 1; i <= ul; i = i + 1){
		square = square + 1;
		cube = cube + 1;
		quad = quad + 1;
			if (i <= ul){		
			document.write("<tr>"); 
			document.write("<td><center>" + i + "</center></td>");
			document.write("<td><center>" + square * square + "</center></td>");				 
			document.write("<td><center>" + cube * cube * cube + "</center></td>" );
			document.write("<td><center>" + quad * quad * quad * quad+ "</center></td>");
			document.write("</tr>");
			
	}	
}
		document.write("</table></body></html>");
	//return;
			
}
Hope this helps to explain.
whill1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top