cancel
Showing results for 
Search instead for 
Did you mean: 

XMLHTTPRequest error

col_edinburgh
Champ in-the-making
Champ in-the-making
the following code:

xmlhttp = new XMLHttpRequest();

xmlhttp.open("GET","http://xxx.xxx.xx.xx/site/getXML.php',true);
xmlhttp.send();

Produces this error:

Failed to create content due to error: 11230444 Failed to execute script 'workspace://S…': 11230443 ReferenceError: "XMLHttpRequest" is not defined. (workspace://S….)

Is it not possible to use XMLHttpRequest in Javascript API ?
5 REPLIES 5

col_edinburgh
Champ in-the-making
Champ in-the-making
OK so it'n not possible to use AJAX with the Javascript API.

As a work around I have now been able to get the xml data into a string using:http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-w.... Top man

So next question. How do I extract the data I need from the string? getElementById throws an 'undefined' error.

mitpatoliya
Star Collaborator
Star Collaborator
Do you want to parse the xml in javascript?
If yes you can refer this link.
http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook#Find_all_XML_Forms_of_a_Specific_Type_and_Retu...

Hope this will serve your purpose.

rocketboy2000
Champ in-the-making
Champ in-the-making
I keep seeing the link "http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-w..." mentioned… but its no longer active.

can anyone provide another link?

I have been trying to do something similar but cant find an example, and the link is dead :C.

Hope someone can provide any information.

Smiley Very Happy

muralidharand
Star Contributor
Star Contributor
Here are the active links.

Steps : http://sonosolobit.it/blog/alfresco-chiamate-webservice-esterni/
Jar file : https://github.com/rivetlogic/acir/tree/master/acir-alfresco/lib

Please note : Downloading and using this jar file at your own risk.