jQWidgets Forums

jQuery UI Widgets Forums Editors Editor Initializing editor with html source view

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  Nadezhda 10 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • mattsbg
    Participant

    Hi,

    i found your fiddle example that it is possible to set the editor in html source view mode after creation.

    However, if I assign content using val it will switch back into html view.

    
    $('#editor').jqxEditor({
        height: 400,
        width: 800,
        theme: 'energyblue'
    });
    $('#editor').jqxEditor('setMode', true);
    $('#editor').val('<div>Line1<br/>Line2</div>');
    

    Though it is possible to call setMode after val , it would be important for me to display it as plain text from the beginning as my html snippets contain javascript code which the editor seems to try to interpret and I get javascript errors.

    thanks for your answer,
    Matt


    Nadezhda
    Participant

    Hello Matt,

    Please, provide us more information about javascript errors and what is your javascript code which you have placed in html.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/


    mattsbg
    Participant

    Hi Nadezhda,

    the error occurred setting a value like this <div><img id="local-logo"/><p><span>Lorem ipsum</span></p></div><script>logo();</script>.
    It seems to me it get interpreted as I got some error like logo is not defined which obviously is not defined within that context.

    For me, I solved it using a standard text area instead. Maybe my thinking was to complex, trying to strip the jqxEditor down instead of just using plain old textarea ;-).

    Please let me know if you want more info on this problem. I can also put together a small example if it will help you. Just provide me an email address where I can send it to.

    thanks,
    Matthias

    Initializing editor with html source view #65300

    Nadezhda
    Participant

    Hi Matthias,

    You can use ‘stylesheets’ property to set the jqxEditor’s stylesheets. For more information about supported functionalities of jqxEditor ,please, refer to API Documentation.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.