• Advanced Browser Check 4.4.1

    Running the below scripts causes the advanced browser plugin to fail.

    This is the php program:-
    function nbl_login_script() {
    $a = “”;
    $b = “”;
    if(is_user_logged_in())
    {
    $b = do_shortcode(“[wpmem_field field=’display_name’]”);
    $a = “Welcome “. $b . ““;
    } else {
    $a = “1Login” ;
    }
    ?>
    <script>
    var nblLogin_passed = “<?php echo $a; ?>”;
    </script>
    <?php
    wp_register_script(‘nblLogin’, get_stylesheet_directory_uri() . ‘/js/nblLogin.js’, array(‘jquery’), ‘1.1’, true);
    wp_enqueue_script(‘nblLogin’);
    }
    add_action( ‘wp_enqueue_scripts’, ‘nbl_login_script’);

    This is the Javascript:-
    function nblLogin() {
    document.getElementById(“nb-login-display”).innerHTML = nblLogin_passed;
    }

    jQuery (document).ready (function () {
    nblLogin(”);
    });

    This is the html it deals with in the Avada header contact field.
    <div id=”nb-login-display”>Login</div>

    It would be nice to have a fix for it. ??

    Bill

  • The topic ‘Running javascript from php program causes failure on Firefox etc’ is closed to new replies.