Javascript - always getting "ajax status 0" error

Hello Remobjects team,

I’m trying out the Javascript client functionality in Remobjects SDK. I have created a service that implements the GetServerTime method just like in the example and publish it through a troJSONmessage and a tROIndyHttpserver.

When I open the URL http://localhost:8099/JSON in my browser, I see the service declaration in my browser so the server is working.

But when I try to query the service from Javascript/html, I always get the “ajax status 0” alert. I’ve tried several different browsers. Am I missing something obvious? I’ve attached the html/javascript here, it is dead simple.

Kind regards,
Arthur

This status 0 error may appear as a result of network issue (incorrect url). Or, if you’re opening your html file from disk, you should enable cross origin access on server. Please read note related to CORS at http://wiki.remobjects.com/wiki/How_to_Write_a_RemObjects_SDK_Server_(Delphi)#Enabling_JavaScript_access_at_the_server