PropertyEventMethodIndex
WebSquare.net - 5.0_4.4547B.20211124.201933

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
nametyperequireddescription
optionsObjectYJSON-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.
Sample
var options = {}; options.action = "http://localhost:8080/test.jsp"; options.mode = "asynchronous"; options.mediatype = "text/xml"; options.method = "post"; options.requestData = "<test/>"; 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
nametyperequireddescription
actionUrlStringYURL to access to download the file
XMLStringYA character string xmlValue is sent to the server. If not specified, other values than xmlValue will be sent to the server.
sendMethodStringYTransmission method (get or post). The default is post.
Sample
WebSquare.net.download( url, "<test></test>", "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
nametyperequireddescription
paramStringNParameter specified in URI
Return
typedescription
StringParameter string
Sample
WebSquare.net.getBASE64Parameter("name");
getParameter( param )
Converts a get type parameter into a string.
Parameter
nametyperequireddescription
paramStringNParameter specified in URI
Return
typedescription
StringParameter string
Sample
WebSquare.net.getParameter("name");