Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2006-01-23 07:47:50

chakal
Xinha Community Member
Registered: 2005-08-10
Posts: 18

onclick event and Firefox insertNodeAtSelection

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

#2 2006-01-23 10:11:49

chakal
Xinha Community Member
Registered: 2005-08-10
Posts: 18

Re: onclick event and Firefox insertNodeAtSelection

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

Board footer

Powered by FluxBB