Forum closed. New forum available at http://community.wymeditor.org/

Loading WYMeditor using $.getScript() method.

Support forum for WYMeditor.

Loading WYMeditor using $.getScript() method.

Postby aargoth on Tue Dec 29, 2009 9:40 am

Hi

Is there a possibility to load WYMeditor dynamically using $.getScript() method? I'm trying to enable WYMeditor on-demand by certain AJAX requests and all it returns to me is this error:

Code: Select all
Błąd: jQuery(jQuery.grep(jQuery("script"), function (s) {return s.src && s.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/);})).attr("src") is undefined
File: http://127.0.0.1:8000/public_html/
Line: 1288


Ofcourse everything is okay when I load required JS file statically using <script> tag placed directly in the HTML file, but I don't want to do it this way.
aargoth
 
Posts: 2
Joined: Tue Dec 29, 2009 9:34 am

Re: Loading WYMeditor using $.getScript() method.

Postby aargoth on Tue Dec 29, 2009 10:13 am

Ok, I've found the problem. The problem is that $.getScript() isn't compatible with the WYMeditor basePath autodetection.

The solution is to disable autodetection by specifying all required paths directly in the WYMeditor configuration like so:

Code: Select all
   $("#editableField").wymeditor( {
              wymPath: "/scripts/wymeditor/jquery.wymeditor.js",
              basePath: "/scripts/wymeditor/"
            });
aargoth
 
Posts: 2
Joined: Tue Dec 29, 2009 9:34 am


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest