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

writing to a frame - moz

i have a popup window that's built from javascript with something like:

source += "<html>";
source += " <head>";
source += " </head>";
source += " <frameset rows='100,*'>";
source += " <frame id='controls' name='controls' />";
source += " <frame id='data' name='data' />";
source += " </frameset>";
source += "</html>";

i'd like to "push" some content into the frames in mozilla. in IE, we
use the following:
popupwindow.document.frames['data'].document.write(source);

but i get an error message that document doesn't exist. i use
mozilla's debugger and surely there's no document object on the frame
object. any ideas on how i can push content into these frames?

thanks!
~mark

Jul 23 '05 #1
3 1534


ml*******@gmail.com wrote:
i have a popup window that's built from javascript with something like:

source += "<html>";
source += " <head>";
source += " </head>";
source += " <frameset rows='100,*'>";
source += " <frame id='controls' name='controls' />";
source += " <frame id='data' name='data' />";
source += " </frameset>";
source += "</html>";

i'd like to "push" some content into the frames in mozilla. in IE, we
use the following:
popupwindow.document.frames['data'].document.write(source);

but i get an error message that document doesn't exist. i use
mozilla's debugger and surely there's no document object on the frame
object. any ideas on how i can push content into these frames?


I guess it is going to work if you start with
<frame name='data' src='about:blank'>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
i add the src, and it still doesn't seem to work. here's a test html
page. i had to turn off the pop up blocker in moz, as i couldn't figure
out how to unblock a local html file.

<html>
<head>
<script language="javascript">

function init() {
alert( 'begin' );

var traceWindow = null;

try {

var iwinWidth = 320; // width of the new window
var iwinHeight = 600; // height of the new window
var iwinLeft = screen.width - (iwinWidth + 10); //(screen.width /
2) - (iwinWidth / 2);
var iwinTop = 10; //(screen.height / 2) - (iwinHeight / 2);
var sConfig="top=" + iwinTop + ",left=" + iwinLeft +",height=" +
iwinHeight + ",width=" + iwinWidth + ",scrollbars=yes, resizable=yes";
var source;

traceWindow = window.open("","_blank", sConfig);

source = "";
source += "<html>";
source += " <head>";
source += " </head>";
source += " <frameset rows='100,*'>";
source += " <frame id='controls' name='controls'
src='about:blank'/>";
source += " <frame id='data' name='data' src='about:blank' />";
source += " </frameset>";
source += "</html>";

traceWindow.document.write(source);
traceWindow.document.close();

source = "";
source += "<html>";
source += " <head>";
source += " </head>";
source += " <body>";
source += "here";
source += " </body>";
source += "</html>";
traceWindow.document.frames['controls'].document.write(source);

} catch (ex) {

alert(ex);

}
}

</script>
</head>
<body onload="init();">
testing
</body>
</html>

Jul 23 '05 #3


ml*******@gmail.com wrote:
traceWindow.document.frames['controls'].document.write(source);


That needs to be
traceWindow.frames['control'].document.open();
traceWindow.frames['control'].document.write(...);
traceWindow.frames['control'].document.close();
to work with Netscape/Mozilla. Should work that way with IE too.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4

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

Similar topics

4
by: ^CeFoS^ | last post by:
Hello to everybody, I've done an application that draws in a frame the trajectory of a robot. The robot position is readed through the serial port, and several commands are wrote through the...
2
by: Maik Wiege | last post by:
Hi! I want to show a blinking text over my derived CMDIChildWnd-class. The blinking is done by one view which is hold by my frame. I set up a timer and write text to the parent frame, which works...
1
by: MTC | last post by:
Hi all and thanks in advance I have an HTML page with 3 frames. Lets call them top middle and bottom. On the top frame there is a button to run some java script! When it is run I want to put...
5
by: Frame | last post by:
I'm looking for tutorials or articles considering HTML Frames and how to handle them with Javascript. E.g. samples how Frames can exchange information, can a Frame instruct other Frame to update...
13
by: Tim Johnson | last post by:
Hello all: I have a page with two frames named "menu" and "display". An event handler in "menu" changes the src attribute for "display", resulting in a different page being loaded for each...
1
by: dduran | last post by:
I'm on Windows XP using Visual C++ 6.0. I need to capture the image in the video frame buffer, modify it by putting a small graphic along the bottom sixteenth of the image, and write it back to...
4
by: xzzy | last post by:
VS 2003, code behind is C# Situation: 1. a webpage has 4 frames: TOP LEFT RIGHT BOTTOM
22
by: Aaron Gray | last post by:
How do I set the innerHTML property of a contained IFRAME ? Many thanks in advance, Aaron
11
by: Krzysztof Retel | last post by:
Hi guys, I am struggling writing fast UDP server. It has to handle around 10000 UDP packets per second. I started building that with non blocking socket and threads. Unfortunately my approach...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.