Hi all!
I'm a new user of FCKeditor and I am looking for
(1) how to run javascript into the editing area of the editor
OR (2) how to capture the event of click in any point of the editing area.
I mean: I saw several examples of the first solution in this forum of these kinds of interactions but I haven't succeed doing it
I give you an example of what I want to do:
You are using <a href="http://www.fckeditor.net/">FCKeditor</a> This is <span id="spanTHERAError1" class="rojo" onClick="alert(hola);">newText</span>
Other solution (2) could be just control the event in the whole text area and then look for the id of the precise element ... but I have neither found anything about how to capture the click event...
I have looked in the configuration file (I'm using the default one) but I don't think the protected source avoid my javascript to work...
Please help me!
I found something that could be relative to my problema: (a post staid without answer):http://www.fckeditor.net/forums/viewtopic.php?f=6&t=6509&p=17501&hilit=+onclick#p17501 .... except that I can't even do the first step!)
First step of the other post:
You are using <a href="http://www.fckeditor.net/">FCKeditor</a></em><strong id="input1" onclick="alert('aaa');">HI</strong>
Thanks to all!
Julia
Re: [javascript running] in the text area, capture click
I'm still Julia.
I have succeedeed to capture the event of click by capturing the one of the whole document of the editor.
I give you he the successful code:
The code has to be inserted in the page that creates the editor in a javascript heading.
I insist that it's a "clean" solution because both behaviours are going to be running: the specific behaviour in the function onClickCapture, and the default one (for example detect if we are in bold tag).
Thanks to all.
Julia
Re: [javascript running] in the text area,event.srcElement ?
well it works but I can't succeed to get the source of the event...
Please would you know how to do?
Julia
Re: [javascript running] in the text area, capture click
This should work to get the event element. hope this helps. By the way there are several js libraries that may be able to help you. Check out http://www.jquery.com. if you have this you can use:
Makes it much easier, although I think the FCK library has some of the same functionality built into it.
Re: [javascript running] in the text area, capture click
Hello and thanks lake
!
Well I've tried everything I'm putting down (commented):
... and nothing has worked! All give me that even is null or undefined
The solution with doc.frames[0].objContent.DOM.parentWindow.event (that comes from another post) seems to be old.
I don't know what to do.
Thanks for your help!
Julia
Re: [javascript running] in the text area, capture click
Re: [javascript running] in the text area,event.srcElement ?
You almost got it right the first time, but you didn't check for the event:
W3C compliant browsers will send it as the parameter to your function, and IE..., well, IE is IE.
Re: [javascript running] in the text area,event.srcElement ?
Hello! and thanks Alfonsomi!
Unfortunately it neither works...
For now the project is "in pause", so I stop looking for a solution.
I work with Linux and an emulator of Internet Explorer 6. With our former editor ,that way to capture the event was working... (the one where I don't have the event e passed in parameter)
I "put" that post in "pause", and will go on when the project starts again... (but it's not solved).
Thanks to all.
And if anybody want to contribuate...
Julia
Re: [javascript running] in the text area, capture click
Re: [javascript running] in the text area, capture click
THANKS A LOT alfonsomi, it works!!!!
Post solved.
Re: [javascript running] in the text area, capture click