• Resolved docwho1234

    (@docwho1234)


    Hello, I have an HTML form which requires a javascript and JQuery to calculate prices. This is what the form looks like with the javascript implemented and everything working correctly: https://counterboosting.com/wp-content/themes/appointment/csgoboost/

    Now I would like to put this form onto my wordpress website page. All the HTML shows up and it seems like the CSS also works but the Javascript just won’t work.

    There are 3 Javascripts and 3 CSS files to be linked, as you can see if you look at the source code of the link I put above.
    I tried to Enqueue the scripts in functions.php file like this:

    function wp_theme_enque_scripts() {
        wp_enqueue_script( 'boosting', get_template_directory_uri() . '/csgoboost/js/boosting.js', array('jquery'), '1.0.0', true );
        wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/csgoboost/js/bootstrap.min.js', array(), '3.3.6', true );
        wp_register_style('bootstrap.css', get_template_directory_uri() . 'csgoboost/css/bootstrap.css', array(), '3.3.6', 'all' ); wp_enqueue_style( 'bootstrap.css');
        wp_register_style('boosting.css', get_template_directory_uri() . 'csgoboost/css/boosting.css', array(), '3.3.6', 'all' ); wp_enqueue_style( 'boosting.css');
    
    }
    add_action( 'wp_enqueue_scripts', 'wp_theme_enque_scripts' );

    I then put this code in the HTML page:

    <script src="https://www.counterboosting.com/wp-content/themes/appointment/csgoboost/js/jquery.js"></script>
    <script src="https://www.counterboosting.com/wp-content/themes/appointment/csgoboost/js/bootstrap.min.js"></script>
    <script src="https://www.counterboosting.com/wp-content/themes/appointment/csgoboost/js/boosting.js"></script>

    This is the page I want the form to display on but the javascript is not working: https://www.counterboosting.com/buy-csgo-rank-boosting/

    I’m really desperate to fix this, its been over a week that I’ve been try this.

    Thank you so much in advance (as you might tell, I am not very experienced in this field)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator cubecolour

    (@numeeja)

    You site has WP Fastest Cache active. Plugins like this aggregate and minify js & css making it difficult to troubleshoot any issues with js or css.

    It is not possible to see whether your scripts and styles have been enqueued correctly.

    If you can disable the cache completely, it may be possible to troubleshoot your issue.

    Thread Starter docwho1234

    (@docwho1234)

    I have resolved the issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘External javascript linking to WordPress’ is closed to new replies.