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

Is-it possible to write in a mother window from a child window ?

Is-it possible to write in a mother window from a child window ?
Like this:
Parent.document.write(............................ ................)
Jul 23 '05 #1
2 1369
"orion30" <or*****@ifrance.com> wrote in message
news:42***********************@news.wanadoo.fr...
Is-it possible to write in a mother window from a child window ?
Like this:
Parent.document.write(............................ ................)


Why not try it and report back to us whether it worked or not?

<script type="text/javascript">
window.newWindowHtml = [
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
'<html>',
'<head>',
'<title>Test Window</title>',
'</head>',
'<body onload="opener.document.write(\'hi there\');">',
'</body>',
'</html>'
].join('\n');
window.open('javascript:opener.newWindowHtml');
</script>

Apparently it does work.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Grant Wagner wrote:
<script type="text/javascript">
window.newWindowHtml = [
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
'<html>',
'<head>',
'<title>Test Window</title>',
'</head>',
'<body onload="opener.document.write(\'hi there\');">',
'</body>',
'</html>'
].join('\n');
window.open('javascript:opener.newWindowHtml');
</script>

Apparently it does work.


However it should not :) You forgot to escape the ETAGO delimiters, hence
it is not Valid HTML. And one also should specify the system identifier
in a DOCTYPE declaration rather than either assuming the UA will use a
reference file or force it into Quirks/Compatibility Mode. It would be
also useful to specify the default scripting language for event handler
attributes no matter if some UAs tested with do not care about that.
PointedEars
Jul 23 '05 #3

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

Similar topics

3
by: James M. Luongo | last post by:
Hello, I am having problems with the mail() function, but I don't know what the problems are. Here is a snippet of code: $to = "jmluongo@comcast.net"; $from = "Gallery@gafok.com";...
2
by: Randell D. | last post by:
Folks, At the begining of my html I have a PHP insert which should be called when the user submits the form that the html contains... I found when the HTML is called fresh (ie not processing a...
4
by: J Sharman | last post by:
What is the easiest way to import an XML Datafeed from a URL into a MYSQL Database? Possibly using PHP Regards Joe PS Please answer to group and joe@joesharman.co.uk
1
by: Lovely Angel For You | last post by:
Dear Friends Hope you all doing great. I am new to PHP and want to know what software is to be installed on my server to run PHP scripts and what softwares are available for creating,...
7
by: Phil Powell | last post by:
I am having this problem: My PHP script will set a cookie, it's there in my /Cookies folder. I delete the cookie (I have to for testing purposes, the PHP script I run behaves according to this...
4
by: davidshook | last post by:
I am a begginer with not too much time on my hand. I do some html pages with Dreamweaver and with some minor Flash actionscript and I have a minor ability (with the help of lots of tutorials) to do...
2
by: Sylvie Stone | last post by:
Hi All - I'm doing a fetch_array and I would like to display a "no records found" message to screen. For some reason this is not working: here's my Postgres SQL as proof: surveys=# select...
7
by: fr? | last post by:
Hi, i have a website , on wich users have to log in credentials are checked against mysql db some session vars are set during login for use somewhere else in the code. Is there a way to...
6
by: Randell D. | last post by:
Folks, I've asked this before but never got any response but its important and I thought I'd pitch it again (hopefully a bit clearer)... One can pass data from one function to another either...
2
by: TimGoogler | last post by:
The only form of database we use is an Excel database. Otherwise is it possible to import the relevant spreadsheet data into say MySQL? Perhaps it is possible but does anyone know how or point me...
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:
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.