WordPress.org

Ready to get started?Download WordPress

Forums

Zia3 CSS JS
[resolved] Javascript issues (4 posts)

  1. Vidyut
    Member
    Posted 10 months ago #

    I was getting javascript issues with this plugin, which were inexplicable, till another plugin's tests (Geo Mashup) showed the following error.

    Uncaught TypeError: Cannot read property 'value' of null
    Source:
    http://aamjanata.com/wp-content/plugins/zia3-css-js/syntax_highlighter/lib/codemirror.js?ver=3.6:3507

    I am no expert, but thought I'd post this here in case it helps.

    http://wordpress.org/plugins/zia3-css-js/

  2. Serkan Azmi
    Member
    Plugin Author

    Posted 9 months ago #

    Hi Vidyut,

    You may have other plugins using the same syntax highlighter that have been uninitialized properly.

    Please send me a list of installed plugins to see if I can replicate the issue. So far there has been no issues with other plugins.

    Cheers

  3. J.D. Grimes
    Member
    Posted 7 months ago #

    I have also experienced this error with the plugin running on one of my clients sites. The error is caused by the JS for this plugin being loaded on every single page in the administration panels. This plugin's JS is trying to initialize the syntax highlighting for the two textboxes, but the textboxes are only on the edit/add post screens, and so on the other screens it gives this error.

    Serkan, you should stop hooking the enqueue functions from the actions that you have them hooked to, and only call them inside of the function that displays the metaboxes. That way the JS will only be loaded on the administration panels where it is actually needed. I edited the plugin to do this, and the error was fixed. And the plugin still worked on the add/edit post screens.

  4. Serkan Azmi
    Member
    Plugin Author

    Posted 7 months ago #

    Thanks for the find, I updated the plugin to only load the required scripts when metaboxes are visible as suggested by J.D. Grimes. Please let me know if this fixed your problem Vidyut.

    Cheers

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.