I know that AJAX makes the page more interactive and real time, but do I need jQuery if I would be using AJAX?
1 Answer
You don't need to jQuery in order to use AJAX. JavaScript has its own way.
Like this:
Initialization
var xmlhttp;
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
Request Sending
xmlhttp.open("GET","demo_get.asp",true);
xmlhttp.send();
You can learn more here about javascript ajax here
1 Comment
GolezTrol
I think by now we can skip the whole IE6- stuff and show how simple Ajax can actually be, even without jQuery.
XMLHttpRequestand you won't need browser-specific exceptions.