You are not logged in.
Hi,
I am making a little plugin but I have a problem with onclick on Firefox (no problem on IE).
To insert an image, I use insertNodeAtSelection for Firefox but it is not render onclick property (or others like onmouseover)
For example, this code:
var img = new Object();
img = document.createElement('img');
img.src = "logo.gif";
img.onclick = "alert('onclick')";
editor.insertNodeAtSelection(img);
Give me:
<img src="logo.gif" align="bottom" border="0" hspace="0" vspace="0" />
How to implement mouse events for Firefox ?
chaK!
Offline
resolved with setAttribute()
var img = new Object();
img = document.createElement('img');
img.src = "logo.gif";
img.onclick = "alert('onclick')";
editor.insertNodeAtSelection(img);
img.setAttribute('onclick', img.onclick);
Last edited by chakal (2006-01-23 10:12:17)
Offline