Support » Plugin: Simple Ajax Chat » “JavaScript not enabled” error when adding to admin dashboard

  • Resolved MG Mason

    (@robear)


    I’m trying to add the chat box to a admin “error notice” and when posting a message I get the “JavaScript not enabled” error. Although the chat box works fine on any regular page.
    I’m testing in the twenty-seventeen theme on my localhost and have a blank “chat url” in “Targeted loading” to allow javascript to load on every page. It looks like jQuery is loading for the admin dashboard, but it seems like when I get the error the page is redirecting to “simple-ajax-chat-core.php” If it will help I can create a test site for you to see, but this is the function I’m adding to functions.php to load the chat box in a “error notice”

    function admin_support_notice() {
    	?>
    	<div class="error notice support">
    	   <h2><?php _e( 'Support is working on your site - Please save your work and wait for this notice to be removed - Thank You!', 'asn_textdomain' ); ?></h2>
               <?php if (function_exists('simple_ajax_chat')) simple_ajax_chat(); ?>
    	</div>
    	<?php
    	}
    add_action( 'admin_notices', 'admin_support_notice' );

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi MG Mason,

    Glad to help. I’m not sure exactly what you are trying to do, but it sounds like it might be outside of what the plugin offers out of the box. One thing I can tell you is that, as of a few versions ago, SAC requires JavaScript in order to work. Specifically, jQuery is required in order for complete functionality. Also the required SAC JavaScript file must be included wherever the chat box is to be displayed.

    Thank you for the feedback, it helped me solve the issue.
    I added the JS file into the function so it would load into the admin header for the dashboard, and now it works well.
    <script type='text/javascript' src='../wp-content/plugins/simple-ajax-chat/resources/sac.php'></script>

    Thanks again 🙂

    Plugin Author Jeff Starr

    (@specialk)

    Very welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“JavaScript not enabled” error when adding to admin dashboard’ is closed to new replies.