|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Execcommand: setting id/class on tags, getting firefox html to be like the IE one
Hello there,
first of all sorry for my english, as I'm french they could (should) be lot of mistakes in my text. I've got 2 problems with execcommand (yes, another wysiwyg editor... ![]() - First I would like to be able to customize some tag I enter (with the execCommand('formatblock', false, tag) with parameters, like an ID, a class, a name, etc... I saw a lot of you talk about the pasteHTML command, but I need my code to be coherent, so if I manually insert with pasteHTML some code, I need to be able to erase it in wysiwyg mode just by pressing the delete/backstab key on my element. - The second point is that I need, for this editor, to get XML code from the HTML generated. The fact is Firefox and IE don't give me the same code. For example IE creates a new <p> each time I press "Enter", when FF just creates a new <br>. Is there a way to "configure" my application to react the same way with IE and FF? I mean creating the same code? Many thanks for your time, Gonnarule. |
|
#2
|
|||
|
|||
|
Start by using DOM1+ methods instead of execCommand().
JavaScript tutorial - W3C DOM introduction http://www.quirksmode.org/dom/ http://www.quirksmode.org/js/dom.html http://www.brainjar.com/ http://developer.apple.com/internet...tent/dom2i.html http://www.mozilla.org/docs/dom/domref/dom_doc_ref.html http://www.mozilla.org/docs/dom/domref/ http://www.w3schools.com/htmldom/dom_obj_document.asp http://www.sitepoint.com/article/rough-guide-dom http://developer.mozilla.org/en/doc...o_DOM_Reference http://digital-web.com/articles/for...nd_the_w3c_dom/ http://www.w3.org/DOM/ |
|
#3
|
|||
|
|||
|
Quote: ![]() |
|
#4
|
|||
|
|||
|
well the fact is I don't have that much time, and doing a DOM based wysiwyg editor looks much more hard (to me) than just using those execCommand().
Btw all is running ok atm, only missing the firefox / IE homogeneity produced code on some commands (like "enter", etc). |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Execcommand: setting id/class on tags, getting firefox html to be like the IE one |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|