1. #1
    dddu88
    Guest

    Default How to insert html code to body tag

    How to insert html code to body tag


    Hi, all, I have a htmleditor missing cursor problem due to the 'infamous Firefox bug', I debugged my code with firebug, and found I need to insert <br _moz_dirty=""/> into the <body> tag to have the cursor working. The original <body> tag looks like this:

    Code:
    <textarea id="message-demo" class="x-form-textarea x-form-field x-border-panel x-hidden" name="msg" autocomplete="off" style="border: 0pt none ; overflow: auto; width: 1053px; height: 95px;" tabindex="-1"/>
    <iframe frameborder="no" name="ext-gen777" src="../../resources/images/default/s.gif" style="width: 1053px; height: 95px;">
    <html>
    <head>
    </head>
    <body style="height: 89px; font-size: 12px; font-family: tahoma,arial,helvetica,sans-serif; background-image: url(http://localhost:8084/extjs/resources/images/default/form/text-bg.gif); background-repeat: repeat-x; background-attachment: fixed;"/>
    </html>
    </iframe>
    Now I need to insert <br _moz_dirty=""/>, so it becomes this:

    Code:
    <textarea id="message-demo" class="x-form-textarea x-form-field x-border-panel x-hidden" name="msg" autocomplete="off" style="border: 0pt none ; overflow: auto; width: 1053px; height: 95px;" tabindex="-1"/>
    <iframe frameborder="no" name="ext-gen777" src="../../resources/images/default/s.gif" style="width: 1053px; height: 95px;">
    <html>
    <head>
    </head>
    <body style="height: 89px; font-size: 12px; font-family: tahoma,arial,helvetica,sans-serif; background-image: url(http://localhost:8084/extjs/resources/images/default/form/text-bg.gif); background-repeat: repeat-x; background-attachment: fixed;">
    <br _moz_dirty=""/>
    </body>
    </html>
    </iframe>
    </div>
    I can use Ext.getCmp('message-demo') to get the component, but this html code is so long, not sure how to insert <br _moz_dirty=""/> into the html body tag?

    Thanks in advance

    Dave

  2. #2
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    i would suggest using the insertFirst method of DomHelper to attach it to document.body.

  3. #3
    dddu88
    Guest

    Default


    Thanks very much for your response, after following your suggestion, I got it working with the cursor.
    One more question: how to remove a tag from the document.body? my another problem is about the enter key, I an enter key is pressed, I need to do something and I set the value to '', the problem is the cursor then always come to next line, and I want it to be at the start of the first line, I checked the html in firebug, it shows two <br _moz_dirty=""/>, I just need one of these, so I need to remove one. I used domhelper.overwrite(doc.body, {}, true); it did not work.

    Thanks again for your help.

    Dave

  4. #4
    dddu88
    Guest

    Default


    Hi, all,
    I got it working now, I just need to call e.stopEvent();

    Thanks
    Dave

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar