Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-16-2005, 06:34 AM   PM User | #1
hexium
New to the CF scene

 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hexium is an unknown quantity at this point
Unhappy window.open does not work on cloned content

This problem only exists on Mozilla based browsers

I have a table with records. You click on an ADD button next to any of the records, and another record is inserted just beneath that record after selecting the type of record from a popup dialog box.

I use cloneNode and insertBefore or appendChild to accomplish this. It works fine in Internet Explorer but Mozilla refuses to execute the window.open command on any of the copied entries.

The error I get is:

Error: uncaught exception: Exception... "Component returned failure code: 0x804b000a nsIDOMJSWindow.open" nsresult: "0x804b000a (<unknown> )" location: "JS frame :: https://jupiter.tut.ac.za/jupiter/ap...pups/dialog.js :: anonymous :: line 44" data: no

Here is a simplified example to show you what happens. It doesn't do much but should get the point over:

https://jupiter.tut.ac.za/jupiter/ap...lems/index.htm

The index.htm contains two javascript functions and I have also linked the two JS files used in this demo.
hexium is offline   Reply With Quote
Old 02-17-2005, 10:47 AM   PM User | #2
hexium
New to the CF scene

 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hexium is an unknown quantity at this point
Thumbs up

Got a solution from gso at mozillazine. By using <a href="javascript:add_entry(this)">here</a> it was possible to still call the wondow.open

I ended up using
Code:
<a onclick="currentnode=this" href="javascript:add_entry(currentnode);">here</a>
since calling the function this way prevents me from reading the A node as "this".

Don't know why Mozilla works like this. Might be a bug?
hexium is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:49 AM.


Advertisement
Log in to turn off these ads.