liran
Newbie
Posts: 3
Joined: Thu Jan 21, 2016 3:24 pm

JS ajax calls

Thu Jan 21, 2016 3:29 pm

hey all I have been trying to do something with JS element like:

Code: Select all

function callServer(endpoint,params) {
    var xmlhttp;
    
 	 xmlhttp = new XMLHttpRequest();
 	 
    
	xmlhttp.setRequestHeader("Content-type", "application/json");
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == XMLHttpRequest.DONE ) {
           if(xmlhttp.status == 200){
               return xmlhttp.responseText;
           }
           
        }
    }

    xmlhttp.open("POST", baseUrl + endpoint, true);
    xmlhttp.send(params);
}
and it seems it doesn't work
advice?

User avatar
Fantom
Help & Support
Posts: 304
Joined: Fri Oct 25, 2013 9:20 pm

Re: JS ajax calls

Fri Jan 22, 2016 2:09 am

Syn.Bot class library sandboxes the JavaScript interpretation so I am unsure if the provided JavaScript would be interpreted properly. I recommend creating a simple Adapter in C# for the task.

Syn Bot Playground

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests