473,385 Members | 1,861 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,385 software developers and data experts.

write to a different frame


Hi,

I've written a very simple test HTML/JS program where
the JS code in one frame writes to a different frame with
"parent.frame1.document.write(...".
This seems to work ok with IE-6, but with NS-7, after the
first write, the "loading" seems to loop forever and if you
click on "stop", the write will not work anymore. Also in
NS, if you push reload, the write will not work anymore.
Both NS and IE seem to perform the write slowly, and in
multiple writes in rapid succession, some will be dropped.

Can someone help ?

Thanks
Ray

Jul 20 '05 #1
4 9181
Ray Schaeffer <re******@cox.net> writes:
I've written a very simple test HTML/JS program where
the JS code in one frame writes to a different frame with
"parent.frame1.document.write(...".
This seems to work ok with IE-6, but with NS-7, after the
first write, the "loading" seems to loop forever
The "loading" state stays until you close the document again
(i.e., "parent.frames['frame1'].document.close()").
and if you click on "stop", the write will not work anymore.
Also in NS, if you push reload, the write will not work anymore.
How "not work". What does the javascript console say?
Both NS and IE seem to perform the write slowly, and in multiple
writes in rapid succession, some will be dropped.


Weird, but that's all I can say without seeing the code.

/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

Thanks for the reply
The code is below and comments interspersed.

Lasse Reichstein Nielsen wrote:
Ray Schaeffer <re******@cox.net> writes:

I've written a very simple test HTML/JS program where
the JS code in one frame writes to a different frame with
"parent.frame1.document.write(...".
This seems to work ok with IE-6, but with NS-7, after the
first write, the "loading" seems to loop forever

The "loading" state stays until you close the document again
(i.e., "parent.frames['frame1'].document.close()").


If you close, to stop the loading, it appears that you cannot
write to it again.

and if you click on "stop", the write will not work anymore.
Also in NS, if you push reload, the write will not work anymore.

How "not work". What does the javascript console say?


a. "not work" = nothing written
b. I have gotten the JS console to give errors, but not can not make
it repeatable. The error is somthing like: "...undocumented error..."

Both NS and IE seem to perform the write slowly, and in multiple
writes in rapid succession, some will be dropped.

Weird, but that's all I can say without seeing the code.

/L


==== Parent ================================================== =====
<HTML>
<HEAD><TITLE>Frames Example</TITLE></HEAD>
<!-- divide into columns -->
<!-- 1st = 50 % -->
<!-- 2nd = whatever is left over -->
<FRAMESET COLS="50%,*">
<FRAME SRC="frame1.html" NAME="frame1">
<FRAME SRC="frame2.html">
</FRAMESET>
<BODY>
</BODY>
</HTML>
==== frame1.html ==================================================
<HTML>
<HEAD><TITLE>Frames Example</TITLE></HEAD>
<BODY>
</BODY>
</HTML>
==== frame2.html ==================================================
<HTML>
<HEAD><TITLE>Frames Example</TITLE></HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from old browsers
//
function doit()
{
//parent.frame1.document.open();
parent.frame1.document.write("Hello<br>");
//parent.frame1.document.close();
//alert("done");
}
//
// end script hiding -->
</SCRIPT>
Frame 2 text<BR>
Hello<BR>

<table border=1 cellpadding=3 bgcolor="#5cacee">
<!-- Buttons -->
<tr bgcolor="#5cacee">
<form NAME="roundit">
<td> <font face=arial size=-1> <b> <p align="center">Rounding</p> </b>
</font>
</td>
<td>
<p align="center"><input TYPE="text" NAME="roundval" SIZE=1> </p>
</td>
<td>
<p align="center"><input TYPE="button" VALUE=" Set "
Onclick="doit()"></p>
</td>
</form>
</tr>
</table>
</BODY>
</HTML>

Jul 20 '05 #3

Here is the error
=================
Error: uncaught exception: [Exception... "Component returned failure code:
0x80004001 (NS_ERROR_NOT_IMPLEMENTED)
[nsIEditorShell.GetSelectedOrParentTableElement]" nsresult: "0x80004001
(NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame ::
chrome://editor/content/editor.js :: goUpdateTableMenuItems :: line 2463" data: no]
================

Thanks

Lasse Reichstein Nielsen wrote:
Ray Schaeffer <re******@cox.net> writes:

I've written a very simple test HTML/JS program where
the JS code in one frame writes to a different frame with
"parent.frame1.document.write(...".
This seems to work ok with IE-6, but with NS-7, after the
first write, the "loading" seems to loop forever

The "loading" state stays until you close the document again
(i.e., "parent.frames['frame1'].document.close()").

and if you click on "stop", the write will not work anymore.
Also in NS, if you push reload, the write will not work anymore.

How "not work". What does the javascript console say?

Both NS and IE seem to perform the write slowly, and in multiple
writes in rapid succession, some will be dropped.

Weird, but that's all I can say without seeing the code.

/L


Jul 20 '05 #4
Ray Schaeffer <re******@cox.net> writes:
If you close, to stop the loading, it appears that you cannot
write to it again.
You can, but when you do, you open the document again, which
clears it. So the old line is erased, and a new, identical, line
is written.

Document.write is only meant for using while a document is being
loaded. That is why an opend document triggers the "loading" icon
stat in Mozilla/Netscape. There is no way to avoid this if you use
document.write to write the data to the new page.

Alternatives are using .innerHTML or DOM (where I prefer DOM):

var otherDoc = parent.frames['frame1'].document;
otherDoc.body.appendChild(otherDoc.createTextNode( "Hello"));
a. "not work" = nothing written
I can see the problem in Mozilla.
b. I have gotten the JS console to give errors, but not can not make
it repeatable. The error is somthing like: "...undocumented error..."


I can't reproduce that, though. I am using Mozilla 1.5a (or usually
Mozilla Firebird 0.6). I don't get lost lines, slow writing or funny
error messages, so I can't help you with that.

/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 #5

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

Similar topics

1
by: Mikko Tussunen | last post by:
I wonder, what would be the best way to write content to another frame? Meaning that as many browsers as possible supports it. I have a frame that reloads with a 3 second interval, and depending...
4
by: Bernard | last post by:
Hi, I am suddenly getting Safari script errors with the following user agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 In a...
2
by: PhoneLover | last post by:
Hi, I have a page with this frameset: <frameset cols="185,800*" frameborder="YES" border="2" framespacing="2" rows="*" bordercolor="#FF0000"> <frame name="leftFrame" noresize...
5
by: imaband | last post by:
Hi, I've got a little Quizzer program that asks a question in the upper frame of a frameset and then lists the answer in the lower frame. Answers can be plain text, straight html, a sound, or a...
3
by: Jofio | last post by:
In my frame based page, I have a hyperlink in the top frame called "header" which, when I click, should make two different pages to be loaded and displayed into two different frames, namely...
3
by: dana lees | last post by:
Hi, I'm writing a C# asp.net web application. I have a frameset in which the upper frame contains a "print" button and the lower frame contains content of a different domain. Since i cannot...
0
by: Svenn Bjerkem | last post by:
Hi, Armed with Programming Python 3rd Edition and Learning Python 2nd edition I try to write an application which I at first thought was simple, at least until I was finished with the GUI and...
4
by: ArrK | last post by:
I want to use a control frame to create and/or modify the content (images and text) of a display frame - all files and images are client side. . When I try to write to the display frame from the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.