Posts the specified params to the given URL asynchronously and invokes the given functions depending on the request status.
Returns the MaxXmlRequest in use.
Both functions take the MaxXmlRequest as the only parameter.
Make sure to use encodeURIComponent for the parameter values.
Example:
post(url, 'key=value', (req) => { alert('Ready: ' + req.isReady() + ' Status: ' + req.getStatus()); // Process req.getDocumentElement() using DOM API if OK... });
Parameters
url: string
URL to get the data from.
params: null|string = null
Parameters for the post request.
onload: Function
Optional function to execute for a successful response.
Posts the specified params to the given URL asynchronously and invokes the given functions depending on the request status. Returns the MaxXmlRequest in use. Both functions take the MaxXmlRequest as the only parameter. Make sure to use encodeURIComponent for the parameter values.
Example: