473,385 Members | 1,622 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.

Writing to an iFrame

I have an existing page that dynamically creates data in a popup
window. I am trying to change it to use an iFrame. Is the following
code valid:

The iFrame is as follows
<iframe src="theframe.html" name="theframe"></iframe>
"theframe.html" is an existing file initially with instructions.

In a script I do
thewindow=window.open("","theframe");
thewindow.document.open();
thewindow.document.write("Some Requested Data");
thewindow.document.close();

This is done multiple times depending on what the user requests each
time. Sometimes this works and sometimes it doesn't. I'm probably doing
someing very wrong but I don't know where to look for reference.

I'm not really opening a window so there must be another way to do it.

What is the best way to write to an iFrame or should I not even try?

--
Dennis M. Marks
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #1
2 9994
"Dennis M. Marks" <de******@dcsi.net> writes:
<iframe src="theframe.html" name="theframe"></iframe> In a script I do
thewindow=window.open("","theframe");
thewindow.document.open();
thewindow.document.write("Some Requested Data");
thewindow.document.close(); This is done multiple times depending on what the user requests each
time. Sometimes this works and sometimes it doesn't.
Bugger! I hate it when it does that.
Do you see any error messages? Do you have error messages turned on?
It could be that the url "" isn't accepted as coming from the same
domain as your page.
I'm not really opening a window so there must be another way to do it.
Try
var thewindow = window.frames['theframe'];
instead of window.open.
What is the best way to write to an iFrame or should I not even try?


I would use the frames collection instead of window.open, but otherwise
it looks fine.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
@SM
"Dennis M. Marks" a ecrit :
I have an existing page that dynamically creates data in a popup
window. I am trying to change it to use an iFrame. Is the following
code valid:

The iFrame is as follows
<iframe src="theframe.html" name="theframe"></iframe>
"theframe.html" is an existing file initially with instructions.

In a script I do
thewindow=window.open("","theframe");
thewindow=parent.theframe;
or
thewindow=parent.frames['theframe'];

or (if page is in a framed page, itself in a fram of main page)
thewindow=top.theframe;
thewindow.document.open();
thewindow.document.write("Some Requested Data");
thewindow.document.close();


variant :
TW = parent.theframe.document;
TW.open();
TW.write("Some Requested Data");
TW.close();
--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************
Jul 20 '05 #3

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

Similar topics

2
by: Csaba2000 | last post by:
I want to be able to embed a single quote into an INPUT element within a dynamically generated IFRAME. The example below shows how the IFRAME is generated. Challenge: I'd like the alert box to...
7
by: iz0nlee | last post by:
is it possible to write text into a page or does the whole page have to be re written using Document.Write? I'm an absolute beginner and wanted to add lines of text when a button is clicked. the...
4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
2
by: marshalli | last post by:
Hi: I have a problem with writing cookie from Jacascript. My problem is that I have two server, one is A, and the other is B. (1) I call a aaa.html from A. In aaa.html : ... <iframe...
7
by: Christopher J. Hahn | last post by:
I'm trying to use a script-generated form to submit to a script-generated iframe. The problem I'm running into is that the iframe is not assuming the name I assign it. IE6 on Win2000. FF1.0.2+...
1
by: =?Utf-8?B?VmlkZHM=?= | last post by:
Hi All, Could anyone help me in resolving this issue? I have an Iframe on my aspx page and I want to insert a String value into that through the code behind.I dont want to use the src attribute...
0
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet...
1
by: Z1P2 | last post by:
I would like to gradually resize an iframe in an onmouseover event. I can easily do it with an image, but when I try to do it with an iframe, it doesn't do anything. So first of all, is it possible...
22
by: Aaron Gray | last post by:
How do I set the innerHTML property of a contained IFRAME ? Many thanks in advance, Aaron
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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.