xmlhttprequest - Getting an error while invoking a REST service using Javascript -


i have developed rest web service resources, able access through java/spring template , xml response coming if type uri on browser.

but when invoke same uri using xmlhttprequest in java script getting below error. "xmlhttprequest cannot load uri(actual uri server name ..etc) . origin file:// not allowed access-control-allow-origin."

uncaught error: network_err: xmlhttprequest exception 101.

my js code below.

    xmlhttp = new xmlhttprequest();  xmlhttp.open( "get", "http://localhost:8080/rest/apps", false ); xmlhttp.send( null ); 

please let me know problem , me resolve this.

regards, sreedhar

here origin local file system, you're loading html page, load call via file:/// . request same origin. if you're trying load somewhere else not error.

check answer


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -