Cross Domain Scripting reverseGeocode Service hosted at

11-03-2011 09:54 AM
New Contributor II

I am trying to invoke a reverseGeocode service hosted at use a simple ajax call.  Initially i got the following error  Origin http://localhost:8181 is not allowed by Access-Control-Allow-Origin.

To avoid the cross domain scripting error i am passing a callback function to this service. Now I keep getting an Unexpected token : error.

Has anybody encountered a similar error making an ajax call to

Or is there an api available in the ArcGIS API for JavaScript to do the same.

<!DOCTYPE html>
  <style>img{ height: 100px; float: left; }</style>
  <script src=""></script>
  <div id="images">

   location: "-75.749655520628295,39.68330984653565",
   distance: "5000",
   outSR: "4326",
   f: "pjson"
  function(data) {


0 Kudos
2 Replies
Frequent Contributor II
Why not use the API for this?
0 Kudos