Hi All,
How can i create a new Ajax object everytime for a particular ajax request, using Prototype library? It seems in Prototype, "Ajax" is a global object and all reqs are its instances. Please help..
Thanks
Hi All,
How can i create a new Ajax object everytime for a particular ajax request, using Prototype library? It seems in Prototype, "Ajax" is a global object and all reqs are its instances. Please help..
Thanks
Actually, Prototype creates a new "instance" for each request. You do it like this:
var request = new Ajax.Request('/your/url', {
onSuccess: function(transport) {
// yada yada yada
}
});
Normally you skip the "var request = " part, unless you need access to the public properties of the instance. One possible reason would be to access the "transport" property which contains the "raw" XMLHttpRequest object.