Page 1 of 1

XMLHttpRequest it's not recognized

PostPosted: Mon Sep 07, 2015 3:12 pm
by marco.rossi
Hi all,

I'm not what we can call a "web-shark".
I have to connect my solution to a big printer.
The printer's producer has provided some javascript samples that are using that object: XMLHttpRequest()
Watching around the web, I've find that page: http://www.w3schools.com/xml/xml_http.asp, in wich is written that
within all the modern browser there's a built-in XMLHttpRequest Object.

The problem is that I'm obtaining this error:
ReferenceError: "XMLHttpRequest" is not defined.
The object is not initialized and, of course, the first related method I call, makes the program to goes in error.
For example on the application server I obtain:
org.mozilla.javascript.EcmaError: TypeError: Cannot call method "abort"

Can anyone tell me why this object is not recognized?
I'm trying all on the servoy webclient.

Servoy 7.4.4, Java 1.8.60.
Tested with Developer on windows 7
Tested with Application server on windows server 2012

Thanks in advance

Marco

Re: XMLHttpRequest it's not recognized

PostPosted: Mon Sep 07, 2015 4:16 pm
by mboegem
marco.rossi wrote:Watching around the web, I've find that page: http://www.w3schools.com/xml/xml_http.asp, in wich is written that
within all the modern browser there's a built-in XMLHttpRequest Object.


Few questions:
1) which browser + version are you testing on?
2) will all users use a 'modern browser'?
3) what/how did you implement so far

If I type var x = new XMLHttpRequest() in the latest Chrome browser, it just works...

Re: XMLHttpRequest it's not recognized

PostPosted: Mon Sep 07, 2015 4:43 pm
by david
marco.rossi wrote:Can anyone tell me why this object is not recognized?
I'm trying all on the servoy webclient.

Servoy 7.4.4, Java 1.8.60.
Tested with Developer on windows 7


Webclient code is run from the context of the server, not the user's browser. And Servoy server is not a browser — the equivalent functionality is the http plugin.

The web client utils plugin makes it easier for you to write code from the user's browser.