Question

I just found, that using jHtmlArea, the nice WYSIWYG text editor, does not work with the newer jQuery versions, from 1.9.1 and above.

I have taken most code from the example, but wanted to reference a current jQuery library.

<body>

    $(function () {
        $("textarea").htmlarea();
    });

    <textarea id="txtDefaultHtmlArea" cols="50" rows="15">
        <p><h3>Test H3</h3>This is some sample text to test out the <b>WYSIWYG Control</b>.</p>
    </textarea>
</body>

I have created a fiddle. Unless I turn on the Migrate 1.1.0 script, the editor does not show the nicely formatted text area, just the bare HTML and the editor buttons do not work.

Here's how it currently looked like:

JSFiddle showing the result

I also have reproduced this behavior with an asp.net WebForms page and with local files.

What can I do about it? Should I go and try to fix jHtmlArea for me? For other components on the page, I would like to use current jQuery. Will I get in trouble, when I reference both an old and newer jQuery version on the same page?

UPDATE: This has now been solved by the autor of jHtmlArea, according to this closed bug.

Was it helpful?

Solution

You can use jQuery migrate for backwards compatibility, and it will show you in the console what needs to be fixed to be up to date with jQuery 1.9+.

From the docs http://blog.jquery.com/2013/02/04/jquery-1-9-1-released/

Please, please, please, use the jQuery Migrate plugin and look at the upgrade guide if you’re just
starting your upgrade to jQuery 1.9. The plugin will quickly find and fix any compatibility issues,
just look in the browser console. Once you fix the warnings you can remove it. Or, leave the plugin in
place until you have the chance to fix your code and plugins to make them 1.9-compatible.

OTHER TIPS

It looks like they released a new version of JHtmlArea that fixed the problem.

https://jhtmlarea.codeplex.com/downloads/get/832017

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top