PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 8, 2022

[FIXED] JQuery is not working: Uncaught ReferenceError: JQuery is not defined | Wordpress

 January 08, 2022     html, javascript, jquery, wordpress     No comments   

Issue

I am looking to get an alert when click on submit button, but getting error when page loads: Uncaught ReferenceError: JQuery is not defined I'm beginner at front-end development, trying to learn javascript and JQuery, can anyone help to fix? Also what went wrong?

html code:

<section>
  <div>
    <div class="row text-center">
      <div class="col-sm-12 text-center">
        <div class="row">
          <div class="col-sm-8 col-sm-offset-2">
            <div>
              <h2>CONTACT US</h2>
            </div>
            <form id="contactForm">
              <input type="hidden" data-form-email="true">
              <div class="form-group">
                <input type="text" class="form-control" name="name" required="" placeholder="Name*" data-form-field="Name">
              </div>
              <div class="form-group">
                <input type="email" class="form-control" name="email" required="" placeholder="Email*" data-form-field="Email">
              </div>
              <div>
                <input type="submit" id="submit" name="submit" class="btn btn-lg btn-danger">
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

Script:

<script>
    JQuery('#contactForm').submit(function(){
    event.preventDefault();
    alert('Working');
    });
</script>

When I checked page source:

<script src='https://yourdevweb.com/testing/wp-includes/js/jquery/jquery.min.js?ver=3.6.0' id='jquery-core-js'></script>
<script src='https://yourdevweb.com/testing/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.3.2' id='jquery-migrate-js'></script>

Solution

It is a typo mistake. Replace JQuery to jQuery will solve the problem.



Answered By - seantsang
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing