postToNewWindow( url, parm1, value1 , parm2, value2, etc… )



This function posts data to a new browser window.

Parameters

  • url – the URL to which the data will be posted

  • parm1 (optional) – the first parameter’s name 

  • value1 (optional) – the first parameter’s value 

  • parm2 (optional) – the second parameter’s name 

  • value2 (optional) – the second parameter’s value 

Example

In this example, we have a tracking number for shipments in an order maintenance application. We are posting this tracking number to the UPS tracking website once the tracking button on the screen is clicked.

Post Tracking Number to UPS Tracking Website
// Get the button object to work with. // "TrackingButton" is the value of the `id` attribute of the target button. var trackButton = getObj ('TrackingButton'); // Assign the onclick event to the retrieved button object. trackButton.onclick = // Event handler function to post data to UPS tracking website. function (event) { // Set variable to the destination URL. var url = 'http://www.ups.com/tracking/tracking.html'; // Set variable to the parameter _name_. var param1 = 'trackNums'; // Set variable to the parameter _value_. var trackingNum = get ('I_6_20'); // Post data to UPS tracking tracking website. postToNewWindow (url, param1, trackingNum); };