Thanks for the reply Steve.<div><br></div><div>I am using bottle to respond to the lat n long which has been sent. Since I am not using CGI, using the cgi proxy is not helping. Also I did try using cgi proxy but it made no difference.<br>
<br><div class="gmail_quote">On Fri, Aug 17, 2012 at 11:45 AM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is you main page loading from <a href="http://128.196.142.94:9000/." target="_blank">http://128.196.142.94:9000/.</a>..<br>
If not you are trying to make an Ajax request to a host that is not the same as the page that you loaded. This is not allowed because of Same Origin Policy. You can setup a proxy to work around this.<br>
<br>
-Steve W<div><div class="h5"><br>
<br>
On 8/17/2012 2:35 PM, Smaran Harihar wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi,<br>
<br>
I am returning a JSON to a GeoExt app and this is the code that is<br>
collecting the return,<br>
<br>
var control = new OpenLayers.Control.Click({<br>
trigger: function(evt) {<br>
var lonLat = evt.xy;<br>
if (popup) popup.close();<br>
var request = Ext.Ajax.request({<br>
url:"<a href="http://128.196.142.94:9000/info?lat=" target="_blank">http://128.196.142.94:<u></u>9000/info?lat=</a>"+<br>
panel.map.<u></u>getLonLatFromViewPortPx(<u></u>lonLat).lat +"&lon=" +<br>
panel.map.<u></u>getLonLatFromViewPortPx(<u></u>lonLat).lon,<br>
disableCaching: false,<br>
success: function(response) {<br>
var obj = Ext.decode(response.<u></u>responseText);<br>
console.log(obj);<br>
console.dir(obj);<br>
addToPopup(lonLat, response.responseText);<br>
},<br>
failure: function(response) {<br>
console.log('server-side failure with status code ' +<br>
response.status);<br>
addToPopup(lonLat, "Server side Failure");<br>
}<br>
//callback: myhandler<br>
});<br>
}});<br>
<br>
I wish to obtain the returned JSON and then assign it to the popUp but<br>
whenever I try to connect to the App it is returning the following error,<br>
<br>
OPTIONS<br>
<a href="http://128.196.142.94:9000/info?lat=55.44873046875&lon=-118.17626953125" target="_blank">http://128.196.142.94:9000/<u></u>info?lat=55.44873046875&lon=-<u></u>118.17626953125</a><br>
405 (Method Not Allowed)<br>
XMLHttpRequest cannot load<br>
<a href="http://128.196.142.94:9000/info?lat=55.44873046875&lon=-118.17626953125" target="_blank">http://128.196.142.94:9000/<u></u>info?lat=55.44873046875&lon=-<u></u>118.17626953125</a>.<br>
Origin null is not allowed by Access-Control-Allow-Origin.<br>
test.html:222server-side failure with status code 0<br>
<br>
If you simply pass the url<br></div></div>
`<a href="http://128.196.142.94:9000/info?lat=55.44873046875&lon=-118.17626953125" target="_blank">http://128.196.142.94:9000/<u></u>info?lat=55.44873046875&lon=-<u></u>118.17626953125`</a> <<a href="http://128.196.142.94:9000/info?lat=55.44873046875&lon=-118.17626953125%60" target="_blank">http://128.196.142.94:9000/<u></u>info?lat=55.44873046875&lon=-<u></u>118.17626953125%60</a>><div class="im">
<br>
you will obtain the JSON but for some reason there is failure that keeps<br>
occurring in the application.<br>
<br>
Is there CORS that can be used in the OpenLayers or GeoExt. I have tried<br>
using ExtJS JSON-P but I am not sure what should I enter in the<br>
'callback' of,<br>
<br>
<script src="<a href="http://domainB.com/users?callback=someCallback" target="_blank">http://domainB.com/users?<u></u>callback=someCallback</a>"></<u></u>script><br>
<br>
<br>
--<br>
Thanks & Regards<br>
Smaran Harihar<br>
<br>
<br>
<br></div>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/openlayers-<u></u>users</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/openlayers-<u></u>users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks & Regards<div>Smaran Harihar</div><br>
</div>