I have the following script
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", "/getSelectedProductData?offerCollectionRef=" + offerCollectionRef + "&brandRef=" + brandRef + "&priceRef=" + priceRef + "&defaultSmallImage=" + defaultSmallImage + "&offerCode=" + offerCode + "&index=" + index, false);
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;
I know how to write a $.ajax in jQuery. But I am stuck at how to send data.
My questions are
- The return is XML and so the
dataType: xml. am I correct? - How should I pass the data to the url?
Please elaborate on these things.
Disclaimer: The thing is that I couldn't test it myself and so this question.