Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > writing to a frame - moz

Reply
Thread Tools

writing to a frame - moz

 
 
mlybarger@gmail.com
Guest
Posts: n/a
 
      05-25-2005
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

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      05-25-2005


http://www.velocityreviews.com/forums/(E-Mail Removed) 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/
 
Reply With Quote
 
 
 
 
mlybarger@gmail.com
Guest
Posts: n/a
 
      05-25-2005
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>

 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      05-26-2005


(E-Mail Removed) 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NS7.1 -- busted Moz registry? JMC acting weird... Gordon S. Hlavenka Firefox 1 10-31-2003 02:58 PM
Moz 1.5 connecting problem.... dw Firefox 5 10-23-2003 04:21 PM
Import Moz 1.2.1 to new computer Moz 1.4 Paul Furman Firefox 1 10-02-2003 10:25 PM
how to use ONE bookmarks.html for ALL moz installs? Oskar Wild Firefox 1 09-19-2003 03:38 PM
Moz virus safe? Voetleuce Firefox 1 08-09-2003 08:59 AM



Advertisments