473,516 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem about creating DIV in parent window from child window

2 New Member
I have a probelm about creating DIV in parent window from child window. following code works find in IE8, but it does not work in IE7 and 6

aaa.html

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>aaa</title>
  4. </head>
  5. <body>
  6. <iframe src=bbb.html height=0 width=0></iframe>
  7. </body>
  8. </html>
bbb.html

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. var objdiv = document.createElement("DIV");
  3. objdiv.id = "testdiv";
  4. objdiv.innerHTML="bbb";
  5. parent.document.body.appendChild(objdiv);
  6. </script>
Jan 2 '10 #1
1 3291
kingfly2000
2 New Member
no need to give solution, i have already found it in this forum, please check:
http://bytes.com/topic/javascript/an...ild-method-ie6

solution is very simple, change

var objdiv = document.createElement("DIV");

to

var objdiv = parent.document.createElement("DIV");
Jan 2 '10 #2

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

Similar topics

2
3790
by: Bostonasian | last post by:
I am trying to append options to dropdown in parent window from option items in child window. In parent window, I have following code: <script language="javascript"> function AddItem2DropDown(item){ exists = false; for(d=0;d<drpDwn.length;d++){ if(drpDwn.options.value == item.value)
3
1673
by: Tyrone Slothrop | last post by:
The first question, is this even possible? What I need to do is pass the contents of a PHP web page from a textarea using window.open method to a new browser window and display it. The page has a combination of HTML and PHP. The problem is that the PHP is not being interpreted. This is generally resolved by using the PHP eval() function....
5
4689
by: Mike Turco | last post by:
What is the difference between creating relationships in the front-end vs. the back-end database? I was trying to create a relationship in a database front-end and noticed that I could not check the referential integrity box. What gives? Continuing on with that line of thinking, I understand what do the relationships do for you in a...
6
2193
by: Nick | last post by:
I'm creating an MDI application with multiple maximized MDI child forms. When a child form is open, the title/caption is merge with the MDI's title/caption. So, if the MDI title is "Parent" and the 3rd MDI child is "Child 3", then when the 3rd MDI child is opened, the title becomes "Parent ". However, when child 3 is closed, the MDI...
10
3984
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms,...
4
1296
by: Erik Leunissen | last post by:
Hello all, I want to distribute a shared library (lets call it "parent.so"), which, in turn, is used to create shared libs by invoking the GNU linker (lets call these shared libs "child.so"). When creating "child.so", some code which needs to be incorporated into each "child.so" comes from "parent.so" itself. I fully control how...
4
5107
by: tcole6 | last post by:
My problem appears to be Firefox specific. I have a hyperlink that loads a new window. This window contains hyperlinks that call javascript functions in the parent window and then closes the child window. The function that is called contains an XMLHttpRequest. My problem is that everything happens as it should, the innerHTML is changed...
7
4799
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the expandable row, the hidden row is made visible with css. The problem is when i sort the rows, the hidden rows get sorted as well which i don't want and want...
4
3967
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and the first child window closes after opening the second child. This is the second time I am typing the post, I lost all content because the site...
0
7182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7142
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7548
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3267
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.