WebSquare.net Package
Type
- engine
Property Summary
Event Summary
Method Summary
- ajax( options )
- AJAX function
- download( actionUrl , XML , sendMethod )
- Downloads a file from the server.
- getAllBASE64Parameter( )
- Converts all get type parameters in Base64 encoding, and returns in JSON format.
- getAllParameter( )
- Converts all parameters into JSON format.
- getBASE64Parameter( param )
- Converts a get type parameters in Base64 encoding.
- getParameter( param )
- Converts a get type parameter into a string.
Property Detail
Event Detail
Method Detail
- ajax( options )
-
AJAX function
Parameter name type required description options Object Y JSON-type object
options.action : AJAX request address options.mode : asynchronous(default)/synchronous options.mediatype : application/x-www-form-urlencoded, application/json, application/xml, text/xml options.method : get/post/put/delete options.requestData : Request data. options.requestHeader : Text to add to the request header. (Used when needed.) options.timeout : Time-out period for AJAX requests. If no response arrives within the time-out, error callback will be executed. options.type : In case of XML, XML objects are defined in responseBody. In case of JSON, a JavaScript object will be defined. In other cases, defined by the Text format. options.beforeAjax : Executed before the request. If "false" is returned by this function, AJAX request will not be made. options.success : A callback function executed upon a successful request. options.error : A callback function executed upon a failed request. options.externalHandler : Converts externally interfaced data such as those for encryption/decryption. s an argument, option object is sent and option.requestData can access the data. After the data is processed, the user-defined function must return a string. Samplevar options = {}; options.action = "http://localhost:8080/test.jsp"; options.mode = "asynchronous"; options.mediatype = "text/xml"; options.method = "post"; options.requestData = " "; options.requestHeader = {"temp1":"hello", "temp2":"world"}; // Add temp1 and temp2 to the request header. options.success = doSucess; options.error = doError; WebSquare.net.ajax( options ); - download( actionUrl , XML , sendMethod )
-
Downloads a file from the server.
Parameter name type required description actionUrl String Y URL to access to download the file XML String Y A character string xmlValue is sent to the server. If not specified, other values than xmlValue will be sent to the server. sendMethod String Y Transmission method (get or post). The default is post. SampleWebSquare.net.download( url, " ", "post" ); - getAllBASE64Parameter( )
-
Converts all get type parameters in Base64 encoding, and returns in JSON format.Sample
WebSquare.net.getAllBASE64Parameter(); - getAllParameter( )
-
Converts all parameters into JSON format.Sample
WebSquare.net.getAllParameter(); - getBASE64Parameter( param )
-
Converts a get type parameters in Base64 encoding.
Parameter name type required description param String N Parameter specified in URI Return type description String Parameter string SampleWebSquare.net.getBASE64Parameter("name"); - getParameter( param )
-
Converts a get type parameter into a string.
Parameter name type required description param String N Parameter specified in URI Return type description String Parameter string SampleWebSquare.net.getParameter("name");