Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ajaxCall question
#6
(09-10-2019, 10:01 PM)kudzu Wrote: Quoted directly from the link that Dan posted:

"Multiply" function can be called from JavaScript using something as:


ajaxCall("Multiply", "&x=5&y=10", false, function(response) {alert("Result is: " + response);});


In the above example, the callback function receives 2 parameters named x and y, and multiply them. The result is put into aResult parameter (which is an out parameter) The difference here compared to old versions is that aResult string is returned to the browser as is, i.e. the response will contain a string representing the result of the multiplication of x by y only, nothing else. This makes much easier to interface with existing JavaScript libraries which expect specific responses (e.g. JSON strings).

The forth type of callback (TIWCallbackProc3) is the most flexible one. It allows you to set the result directly using variable aResult (as above) or still use TIWApplication.CallbackResponse object (as in IW 15.0), or yet, bypass the response completely setting aHandled parameter to True. Setting aHandled to True means that the user code is responsible for creating the reponse. In this case, IntraWeb will skip the execution of callback response code completely.

Thanks for pointing it out.
Reply


Messages In This Thread
ajaxCall question - by joel - 09-10-2019, 04:15 AM
RE: ajaxCall question - by Jose Nilton Pace - 09-10-2019, 02:30 PM
RE: ajaxCall question - by DanBarclay - 09-10-2019, 06:38 PM
RE: ajaxCall question - by joelcc - 09-10-2019, 09:56 PM
RE: ajaxCall question - by kudzu - 09-10-2019, 10:01 PM
RE: ajaxCall question - by joel - 09-11-2019, 02:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)