-1

i have problem with this block of ajax code, this function is triggered by onChange event on combobox,

function showDistr()
{
 idstate = document.getElementById("statepar").value;
 $.ajax({
   url:'load_distr.php/?id="+idstate +"',
   success: function(response) {
     $('#dist').html(response);
   },
   dataType:"html"
   });
  return false;
}

this is the combobox,

<select class="form-control" id="statepar" onChange="showDistr()" style=\"WIDTH: 250px; HEIGHT: 22px\" >

it comes error "Uncaught ReferenceError: $ is not defined" on $.ajax({

anyone give me suggestion about this?

thank you

user3843319
  • 3
  • 1
  • 3

3 Answers3

0

You have not include jQuery library, before first use of $.

Refer: Uncaught ReferenceError: $ is not defined error in jQuery

Community
  • 1
  • 1
Kamal Nayan
  • 1,890
  • 21
  • 34
-1

Include jquery.js library file in project.

jquery-2.1.4.min.js

Krishnaraj
  • 126
  • 1
  • 8
-1

Include jQuery script file to your code

<!-- include jquery -->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>