473,473 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DOM on new open window

26 New Member
Hello.


I have a question regarding method window.open(...) or open(...).

If i use this method to open a new window, is it possible to use DOM to append objects to that same window, or is it restricted.

I have been searching for foruns and web in general, there seems not having a straight answer.

Giving an example, with an event Listener i detect the keypress "Enter", which in then it triggers the opening of a new window with the intended page, in this case the same page, but i wanted to change some parts of it by adding objects to it (append them).
Expand|Select|Wrap|Line Numbers
  1. newWindow = window.open('test.html','newWindow','width=640,height=480,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
  2.  
  3. var tmp = newWindow.document;
  4.  
  5. var divAll = containerDiv = document.createElement('DIV');
  6.     divAll.id = "area-"+Number;
  7.     divAll.style.height = 45+"px";
  8.     divAll.style.width = 45+"px";
  9.     divAll.overflow = "scroll";
  10.     divAll.overflow.x = "hidden";
  11.     divAll.overflow.y = "auto";
  12. var containerDiv = document.createElement('DIV');
  13.     containerDiv.id = "div_"+Number;
  14.     containerDiv.name = "original";
  15.     containerDiv.style.height = 45+"px";
  16.     containerDiv.style.width = 45+"px";
  17.     containerDiv.style.position = "absolute";
  18. var project = document.createElement('IMG');
  19.     project.id = "projecto_"+number;
  20.     project.numero = number;
  21.     project.style.height = 45+"px";
  22.     project.style.width = 45+"px";
  23.     project.style.position = "absolute";
  24.     project.setAttribute('src', "7656756.jpg");
  25.  
  26.     containerDiv.appendChild(project);
  27.     divAll.appendChild(containerDiv);
  28.     tmp.getElementById('myArea').appendChild(divAll);
  29.  
  30.  
The following error appears: This interface is not supported ...

Is it possible to use a page to call itself with the method window.open(...) and then use DOM to change its content ? Or is it a restriction or problem with same Origin Policy ?

Thank You
Jun 16 '10 #1
1 1823
acoder
16,027 Recognized Expert Moderator MVP
It's possible that the new window has not fully loaded. You could set tmp in the parent window from the child window when it (the child window) has fully loaded (onload event).
Jun 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ben | last post by:
Hi there, in a form, here's what I want to do : <input type=button onclick= (???) is it possible to open a pop-up window with a specified url without using javascript ? Thanks
1
by: Matt | last post by:
My problem is when the user click the submit button, it will launch another new window for the request page. I want to confirm we cannot use JavaScript open window functions to open a request page?...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
3
by: Grey | last post by:
I know I need to use client side script to open new window, window.open("URL"). However, the URL in the function is dinamically generated by server side. How can I open window in client side, but...
4
by: gabe | last post by:
i have a solution to gather the text in each window that is open, but would rather use only managed code rather than unmanaged code my current solution relies on. The purpose is to get the text in...
1
by: Alejandro Vidal | last post by:
Hi, I have a curius problem, I hava a flash in a html page. In flash I have a button to open a pop up with this code: getURL...
2
by: Martin Mosbæk Christiansen | last post by:
Hi I have been searching this group but I haven't found anything I can use... Is it possible to remote modify an already open window form from a local HTML file? Example (simplified): 1....
1
by: peerraghu | last post by:
hi i am creating travels project using .net and c# and iam new to java scripts i want to open new window with in the same page after clicking the image i have wreiten code just look at this ...
1
mageswar005
by: mageswar005 | last post by:
Hello, In My Application i have open the PDF file from javascript open.window function.In This scenario i want to control / Hide the PDF Toolbar from open.window function. My Current code is...
1
by: hcoulange | last post by:
I am trying to open a window inside a DIV or a table cell. In the stylesheet I put a #container and a #jx, In my page I have first a div id=container and another DIV call jx the first with position...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.