hclleapforum

Open full view…

XMLHttpRequest in the JavaScript does not work

juergenkringe
Wed, 22 Jan 2020 11:48:04 GMT

Hello, I build up an app to organize a conference schedule. After a user submits a session the organizer can approve or decline the session and assign a session slot. This workflow is working fine and in the next step I will push this data using RestAPI to sched.com. My problem is I can not use a service and the JSON POST function because sched.com does not support this function. They only use GET URL commands. It should be equal to the example in the wiki: https://hclleapwiki.atlassian.net/wiki/spaces/HL/pages/590018/Client+side+REST+calls+from+JavaScript+-+Zip+Code+Lookup+Example But when I try to use XMLHttpRequest in the JavaScript I got a Syntax error "Illegal reference to XMLHttpRequest". The same if I import your ZIP-application. How can I use the XMLHttpRequest function in LEAP? Or do you have any other idea to solve my problem? Thanks for your help, let me know if you need more information. Regards Jürgen

christopher_dawes
Wed, 22 Jan 2020 17:07:01 GMT

What is set in your Leap_config.propreties for the secureJs property? Is it true or false? If it is true (or commented out) then the javaScript is operating within a sandbox and the XMLHttpRequest is not available. The alternative would be to use the Service by URL feature to call the shed.com api. The service by url feature provides the capability of building any http request and it should work just fine for your purpose.

juergenkringe
Thu, 23 Jan 2020 13:47:43 GMT

Thanks for your help. I changed the secureJS setting to false and the XMLHttpRequest works perfect for me!