KMSFroalaEditorBundle icon indicating copy to clipboard operation
KMSFroalaEditorBundle copied to clipboard

$(...).froalaEditor is not a function

Open reggin opened this issue 10 years ago • 21 comments

Hi Just installed your bundle. I've add configuration, add froala to form (a form field type). And have error $(...).froalaEditor is not a function. froala_editor.min.js loaded also. What could be the problem?

reggin avatar Feb 15 '16 13:02 reggin

Hi, do you manually loads javascript or let the bundle include it ?

sguionni avatar Feb 15 '16 14:02 sguionni

Hi, Sorry for delay. I let bundle to include it. Now I tried to include manually - and it works now, thanks!

reggin avatar Feb 18 '16 15:02 reggin

@Jakub-Fajkus Hardcode :) <script src="{{ asset( 'bundles/kmsfroalaeditor/froala_editor_2.1.0/js/froala_editor.min.js' ) }}"></script>

The same I've added plugins and styles.

reggin avatar Feb 18 '16 19:02 reggin

I'll take a look and maybe ask you some questions about your configuration, libraries...

sguionni avatar Feb 18 '16 19:02 sguionni

I think I found the problem. I am trying this on dev environment which is much slower than production. On production, it works without problem. I suppose the problem was because the jQuery's function ready() got triggered before the "froala_editor.min.js" file was fully loaded.

Jakub-Fajkus avatar Feb 19 '16 08:02 Jakub-Fajkus

I used to load all javascripts at the botton of the page and was having the same problem..

I just had to put jQuery js on the

tag and everything loaded correctly.

pedrocasado avatar Mar 14 '16 16:03 pedrocasado

I have the same problem too

ghost avatar Jul 29 '16 08:07 ghost

Same problem

dcognata avatar Aug 18 '16 18:08 dcognata

Yes, sometimes javascript files are not fully loaded, or some plugins are missing, need to investigate..

sguionni avatar Sep 09 '16 00:09 sguionni

I have the same problem.

ghost avatar Sep 12 '16 19:09 ghost

Samething happened to me. I put includeJS to false in the config.yml and then included it myself. That solved the problem.

jk- avatar Sep 27 '16 01:09 jk-

Me too.

ghost avatar Sep 27 '16 06:09 ghost

Same problem for me. But even after including the js manually, i still got the same error.

krisElphenor avatar Dec 14 '16 16:12 krisElphenor

I solved, "Samething happened to me. I put includeJS to false in the config.yml and then included it myself. That solved the problem."

2016-12-14 17:25 GMT+01:00 krisElphenor [email protected]:

Same problem for me. But even after including the js manually, i still got the same error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/froala/KMSFroalaEditorBundle/issues/9#issuecomment-267080096, or mute the thread https://github.com/notifications/unsubscribe-auth/AQySYG0JhaguTgA3F-TYRMTKvdbVA2viks5rIBhwgaJpZM4HaWqY .

ghost avatar Dec 14 '16 22:12 ghost

@gacel112 Yes, I tried that as well, no luck so far...still getting the same error

krisElphenor avatar Dec 15 '16 08:12 krisElphenor

I solved it by using the getScript function of jQuery.

$.getScript("/path/to/js/froala_editor.min.js", function () { $( "textarea" ).froalaEditor({ ... }); });

Apparently, for me as well, the problem is the js not being fully loaded when the function froalaEditor is called. But i cant't explain why, even after loading the script manually both in the header and at the bottom of the page, I still get the same issue.

So, if someone else has the same problem, jquery getscript could be your 'plan C'

krisElphenor avatar Dec 15 '16 09:12 krisElphenor

Same here... No solution jet?

somoza avatar Oct 15 '18 01:10 somoza

Same problem ...

seddighi78 avatar Feb 03 '19 09:02 seddighi78

Also same

Levii01 avatar Jan 12 '20 10:01 Levii01

same issue

dev-vishnupundhir avatar May 28 '20 01:05 dev-vishnupundhir

any updates here?

Mifrill avatar Nov 24 '20 10:11 Mifrill