Plugin throws JS error
-
Hi Thomas,
thank you for your very useful plugin!
I am using WP 5.5.3 and the plugin does not work correctly with posts that have images in them.
The file image-source-control-isc/admin/assets/js/post.js throws this error in the JS console:
Uncaught TypeError: jQuery(...).live is not a function at IscBlockForm.attach (post.js:182) at HTMLDocument.<anonymous> (post.js:221) at i (jquery.js:2) at Object.fireWith [as resolveWith] (jquery.js:2) at Function.ready (jquery.js:2) at HTMLDocument.J (jquery.js:2)
When I change lines 182 and 192
fromjQuery(main_selector).live('submit', function(){
jQuery(fields[id].selector).live('change', function(){
to
jQuery(main_selector).on('submit', function(){
jQuery(fields[id].selector).on('change', function(){
Everything works as expected. You might want to change this in the code.
The live() function has been deprecated in newer versions of jQuery, see https://api.jquery.com/live/
- The topic ‘Plugin throws JS error’ is closed to new replies.