473,407 Members | 2,312 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,407 software developers and data experts.

Clear the contents of a frame/iframe?

Hi, all!! Trying to clear the contents of a frame (or iframe), and can't
seem to find anything that works. Tried:
* innerHTML
* outerHTML
* document.close(); (with a number of different frame order prefixing)
* location.href='about:blank';

Anyone have any ideas for me? :) I essentially need to clear the content
WITHOUT doing any kind of post/redirect from the window.

Thanks!
Jack


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 20 '05 #1
2 16563
"Jack Black" <ja*************@hotmail.com> writes:
Hi, all!! Trying to clear the contents of a frame (or iframe), and can't
seem to find anything that works. Tried:
* innerHTML
* outerHTML
* document.close(); (with a number of different frame order prefixing)
* location.href='about:blank';

Anyone have any ideas for me? :) I essentially need to clear the content
WITHOUT doing any kind of post/redirect from the window.


More detail about what you have done would be helpful. How did you use
innerHTML? What location did you change?

If "windowRef" is a reference to the window object of the frame you want
to close, then
windowRef.document.open();
windowRef.document.close();
should do it.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
DU
Lasse Reichstein Nielsen wrote:
"Jack Black" <ja*************@hotmail.com> writes:

Hi, all!! Trying to clear the contents of a frame (or iframe), and can't
seem to find anything that works. Tried:
* innerHTML
* outerHTML
* document.close(); (with a number of different frame order prefixing)
* location.href='about:blank';

Anyone have any ideas for me? :) I essentially need to clear the content
WITHOUT doing any kind of post/redirect from the window.

More detail about what you have done would be helpful. How did you use
innerHTML? What location did you change?

If "windowRef" is a reference to the window object of the frame you want
to close, then
windowRef.document.open();

Exactly!
"open: Open a document stream for writing. If a document exists in the
target, this method clears it."
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-72161170
windowRef.document.close();
should do it.

/L


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #3

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

Similar topics

2
by: Halldór Ísak Gylfason | last post by:
In my application I have an iframe that is empty (and not visible) initially, however when a user presses a button a form is programmatically submitted and the target is set to the IFrame. I...
3
by: John Chen | last post by:
I need to use iframe to create a floating frame. But the contents in the iframe is not a external html file. Rather, it will be dynamically created by jsp. How can I set the src attribute to a URL...
2
by: Alan Fiddis | last post by:
Just a quick question folks - is it possible to clear a document, frame or iframe of its entire contents? I know there's document.clear(), but it doesn't seem to do anything. :-(
6
by: NoCopy na | last post by:
Using the following example: domiframetest.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
4
by: primary0 | last post by:
Hi, I have a page containing an external javascript which loads an image onto the webpage. How would it be possible to use javascript to read the filname (and the dimensions) of the loaded image...
3
by: Vongza | last post by:
<html> <head> <title>Cross Frame Reference</title> <script language="javascript"> function showThisTitle() { alert(document.title); } function showAnotherTitle() { try {...
6
by: DRS.Usenet | last post by:
When I run alert("page contents:" + content.document.documentElement.innerHTML); I am able to pull the content. I see something like this page contents:<head><title>A Title</title>...
4
by: maminx | last post by:
Hello..i have problem, hope someone can help me..i have this frameset below : <FRAMESET ROWS="55%" COLS="37%,63%"> <FRAME NAME="runningTrade" SRC="http://runningtrade.com" scrolling="no"> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.