0

I need to call a php file through ajax. I tried following:

<html>
<script type="text/javascript">

setInterval(function(){
test();
},3000);

function test(){     
$.ajax({
    type: "POST",
    url: "GetMachineDetail.php",
    data: "{}",
    success: function(response){
         alert("suceccess");}
    });
}

It's simple javascript jquery calling... But I've got an ajax not found error.

Question: How could I solve this issue?

BlitZ
  • 12,038
  • 3
  • 49
  • 68

2 Answers2

2

Need to include jquery library in HTML.

It's giving error just because using jquery without library.

Rohit
  • 403
  • 3
  • 15
1

$ is a (poorly named) function supplied by the jQuery library. You need to include that library in your page before you try to use it.

You can get it from the jQuery website (where you will also find instructions on how to use third-party hosted versions).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335