Calling .dyalog with AJAX

MiServer is Dyalog's APL-based web development framework

Calling .dyalog with AJAX

Postby MBaas on Wed May 27, 2015 8:18 am

In my page, I'd like to integrate a new .dyalog-page to retrieve and format some data and return it via JSON for further processing by JS.
How can I return that JSON-Array from the .dyalog-page (in response to the ajax-call)?
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: Calling .dyalog with AJAX

Postby MBaas on Wed May 27, 2015 2:25 pm

I found it:

the called page has to have a public method 'APLJax' which may return a string. (It would be nice if it was possible to return a JSON-Array as well, but I haven't been able to do so - pls. correct me if it is)...
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: Calling .dyalog with AJAX

Postby MBaas on Thu May 28, 2015 6:16 pm

And JSON is possible as well!

The jQuery-Call is something like
Code: Select all
   $.ajax({
       method: "GET" ,
       dataType: "json" ,
       url: "listen_details.dyalog",
       data: {id: the_id} ,
...


and then APLJax may return R← 0(7160⌶) of a vector :-)
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany


Return to MiServer

Who is online

Users browsing this forum: No registered users and 0 guests