I'm trying to make: $.ajax
but it gives me error: $ is not defined
.
Question1: But I want to include the jquery on javascript file, it's possible?
Question2: I want to make an asyncronous
request GET
. It's another way without jquery ajax?
I'm trying to make: $.ajax
but it gives me error: $ is not defined
.
Question1: But I want to include the jquery on javascript file, it's possible?
Question2: I want to make an asyncronous
request GET
. It's another way without jquery ajax?
Looks like you haven't included jQuery to main page, from where you're sending a request. (make sure that jquery should be loaded before your js file)
About second question: $.ajax
have param named async
. I think this is what you need.
You can include jQuery on javascript file. simply add a reference to it.
<script src="jquery.js"></script>
If you don't want to use jquery ajax function, simply use XMLHttpRequest. here's an example: http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp