GeoNames Home
|
Postal Codes
|
Download / Webservice
|
About
GeoNames Forum
Search
Recent Topics
Back to home page
Register
/
Login
About Permission denied to call method XMLHttpRequest.open
Forum Index
->
FAQ - frequently asked questions
Author
Message
21/08/2008 10:39:00
Subject:
About Permission denied to call method XMLHttpRequest.open
yoland
Joined: 21/08/2008 10:03:40
Messages: 2
Offline
Hi ,marc. i am foreign user.
i want find location use the longitude and latitude. But i have this problem(No Permission).
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(){
createXMLHttpRequest();
try{
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("post", "http://ws.geonames.org/findNearbyStreetsJSON?lat=37.451&lng=-122.18", true);
xmlHttp.send(null);
}catch(exception){
alert(exception);
}
}
function handleStateChange(){
if(xmlHttp.readyState == 4){
if (xmlHttp.status == 200 || xmlHttp.status == 0){
var resp = xmlHttp.responseText;
var func = new Function("return "+resp);
var json = func();
alert("JSON's value: " + json.adminName1);
}
}
}
</script>
</head>
<body>
<input type="button" value="return ajax JSON's value"
onclick="startRequest();" />
</body>
How do i it?
Thanks
28/08/2008 16:18:37
Subject:
Re:About Permission denied to call method XMLHttpRequest.open
bbqfrito
Joined: 27/08/2008 22:41:30
Messages: 5
Offline
By default browsers will not let you perform XMLHttpRequests across domains using javascript. Create a proxy that queries the external webservice on your existing domain and then perform a request on your proxy.
30/08/2008 18:12:34
Subject:
Re:About Permission denied to call method XMLHttpRequest.open
marc
Joined: 08/12/2005 07:39:47
Messages: 4416
Offline
Yoland
This thread describes the problems and solution:
http://forum.geonames.org/gforum/posts/list/11.page
Marc
01/09/2008 05:03:47
Subject:
About Permission denied to call method XMLHttpRequest.open
yoland
Joined: 21/08/2008 10:03:40
Messages: 2
Offline
thank you for you help
Forum Index
->
FAQ - frequently asked questions
Go to:
Select a forum
Forum in English
-------------
General
Administrative Divisions
FAQ - frequently asked questions
Postal Codes
Discussion of GeoNames Toponyms
Forum in other language
-------------
Forum in Deutsch
Powered by
JForum 2.1.5
©
JForum Team
info@geonames.org
GeoNames Home
Postal Codes
Download / Webservice
Forum
About