POSTing with the builtin ajax functions?

i'm thinking it's not possible, but is it?
i would like to ajax some data to a php script via POST instead of GET.
i would like to ajax some data to a php script via POST instead of GET.
0
This discussion has been closed.
Comments
hey Mark, i know you hate javascript, so if you're interested, i changed the LoadData function in DataManager in js/ajax.js with this:
this.LoadData = function(DataSource,postVars) { if(undefined === postVars) postVars = false; // Debug // document.location = DataSource; var Request = this.InitiateXmlHttpRequest(); if (Request != null) { try { Request.onreadystatechange = this.CreateDataHandler(Request); if(!postVars) { Request.open("GET", DataSource, true); Request.send(null); } else { Request.open("POST", DataSource, true); Request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); Request.setRequestHeader("Content-length", postVars.length); Request.setRequestHeader("Connection", "close"); Request.send(postVars); } } catch(oc) { alert(oc); } } }
that way it doesn't break any part of the site that's already using ajax, and it allows POSTing by calling it with post variables (i.e. "s=some%20urlencoded%data") as the second argument.
I just spent the entire evening going through all of Vanilla's javascript changing stuff. I don't feel like going back into the woods right about now, sorry