Summary: | document.appendChild does not work with img | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Jos van den Oever <jos> |
Component: | khtml ecma | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | maksim |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
file showing the bug
html with image that resizes with browser window html with image that resizes with browser window |
Description
Jos van den Oever
2003-09-22 00:41:13 UTC
Created attachment 2556 [details]
file showing the bug
When one views this page with javascript "Report errors" turned on, the following error is reported when the page is resized: ----- An error occurrred while attempting to run a script on this page. http://bugs.kde.org/attachment.cgi?id=2556&action=view line 15: Error: DOM Exception 8 ------ The number 8 corresponds to the DOM Error NOT_FOUND_ERR (according to kdelibs/ khtml/dom/dom_exception.h. I don't know what this means. function newimage() { newimg = new Image; newimg.src = 'thumbs/20030828182016.jpg'; newimg.alt = "image"; // newimg.setAttribute('width', '100px'); // newimg.setAttribute('height', '100px'); var div = document.getElementById('main'); div.appendChild(newimg); return false; } Is it just me or isn't appendChild supposed to take a Node created by the corresponding document? I don't know what an Image is, BTW. I tried searching through the javascript docs at msdn + google and I didn't find it. regards, luis Created attachment 2973 [details]
html with image that resizes with browser window
This file shows the mentioned bug in an html file that is used in galleries.
The JavaScript in the page resizes the image so that it always fits the window.
This file works well in recent versions of Mozilla, IE and Opera.
Created attachment 2974 [details]
html with image that resizes with browser window
This file shows the mentioned bug in an html file that is used in galleries.
The JavaScript in the page resizes the image so that it always fits the
window.
This file works well in recent versions of Mozilla, IE and Opera.
This bug is still present in KDE 3.2.1. Attachment 2974 [details] still does not work in Konqueror 3.3. The error message is still the same: ----- An error occurrred while attempting to run a script on this page. http://bugs.kde.org/attachment.cgi?id=2556&action=view line 15: Error: DOM Exception 8 ------ Confirming the bug in Konqueror 3.3.2. As a workaround until that bug is fixed, you can replace the line newimg = new Image; with newimg = document.createElement('img'); That does the same and it's standards compliant, too. |