Summary: | Assigning functions to javascript events does not work | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | djoham |
Component: | kjs | Assignee: | Konqueror Developers <konq-bugs> |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
djoham
2001-07-01 22:03:26 UTC
I've investigated further and found another similar bug that's close enough to be placed here. Let me know if you would like to have this in its own bug... It looks like Konqi won't let you set any of the even handlers for elements native events. The menus create a new div and then assign onclick onmouseover and onmouseout events to handle mouse input. Konqi seems to ignore these assignments. Run the following code in Mozilla. It works as expected. Konqi creates the DIV but then does nothing else... <html> <body> <form> </form> <input type="button" id="button" value="createDiv" onclick="createDiv()"> </body> </html> <script language="javascript"> function createDiv() { var x = document.createElement("DIV"); x.id = "newDiv"; x.style.position = "absolute"; x.style.height = "200px"; x.style.width = "200px"; x.style.top = "200px"; x.style.left = "200px"; x.style.backgroundColor = "red"; x.innerHTML = "hello"; x.onclick = charlie; x.onmouseover = mouseOver; x.onmouseout = mouseOut; document.body.appendChild(x); document.getElementById("button").disabled = true; } function charlie() { alert("Hi I'm charlie"); } function mouseOver() { document.getElementById("newDiv").style.backgroundColor = "blue"; } function mouseOut() { document.getElementById("newDiv").style.backgroundColor = "red"; } </script> Thanks. Please let me know if there is anything else I can do to help. David __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ Works now. Added the two testcases to our repository btw. |