-1

I have a problem. I don't know how to do AJAX request from Alfresco javascript webscript(not from Share!!!). When I'm use standart way to create request via XMLHttpRequest i got a error - "XMLHttpRequest is not defined". From share I do request via YUI, but in Alfresco I didn't found standart tools for this. If anyone know how to do that, please, answer. Thank you.

VladislavLysov
  • 651
  • 1
  • 11
  • 25
  • can [this](http://stackoverflow.com/questions/7282660/http-request-from-webscript-in-alfresco) help? – skuro Jun 25 '12 at 15:22

1 Answers1

1

You didn't found "standard tools" for this because it's not "stanrdard". There's no root object named "XMLHttpRequest" defined in alfresco javascript API. :)

You can't easily do this with JavaScript based webscript but you CAN do it with Java based webscripts with ease. Just include your favourite REST library and make a request. You can also make JavaScript extension using Java and use that in JavaScript based webscripts to do REST calls if you really want to use that in JavaScript based webscripts.

Hope that clears it up a bit... :)

Matjaz Muhic
  • 5,328
  • 2
  • 16
  • 34