Function post

Posts the specified params to the given URL asynchronously and invokes the given functions depending on the request status. Returns the in use. Both functions take the as the only parameter. Make sure to use encodeURIComponent for the parameter values.

Example:

mxUtils.post(url, 'key=value', (req)=>
{
mxUtils.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.

    • onerror: null | Function = null

      Optional function to execute on error.

    Returns void