![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi all! I dymically replace the child nodes of a DIV element by image nodes. In IE and Firefox this works properly. In Safari it works properly, too - but only if the site is called locally, eg. with file://. Uploading to a server and viewing the site in Safari with http:// results in an error. The problematic code is the following: var node = document.createElement("img"); node.setAttribute("src", filename); node.setAttribute("style", "position:absolute;left:100px;"); // error document.getElementById(name+"Images").appendChild (node); When executing this script on Safari in online mode (again: with a _local_ file, it works fine!), Safari reports the following error, occuring in the marked line: "[592] :TypeError - No default value" Obviously, node.style seems not available at this point. I think Safari's still loading the image, and while loading it blocks all accesses to node. Is this assumption correct? |
|
That would mean that in Safari, I cannot do _anything_ with the image node until the image is loaded. These are not really bright prospects. Regards, -.Lutz.- PS: I tried to enclose the image nodes in DIV elements and to apply style properties to the DIVs. That lead to a DOMException 8 ("node does not exist") when calling appendChild(node). |
![]() |
| Thread Tools | |
| Display Modes | |
| |