views:

51

answers:

3

I have a problem making a request to a server My simple code is:

<html>
<head>
<script type="text/javascript" src="/Users/t/Desktop/App/etc.../jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/Users/t/Desktop/App/etc.../json_parse.js"></script>
<script type="text/javascript">

$.getJSON("http://127.0.0.1:8000/search/",{long:"29"},
    function(data){
    alert("data is"+ data.place[0].pk);
    });

</script>
</head>
<body>
<div id="test"></div>
</body>
</html>

I can not get a "GET /search/?long=29 HTTP/1.1" . I always get a "OPTIONS /search/?long=30 HTTP/1.1" Also when i check it with Firebug it says 0 requests. Why is that?

A: 

it's because even though it's not TECHNICALLY cross domain, javascript thinks it is, and won't let you do it.

contagious
A: 

What domain is this page being servered from? localhost? localhost:8000? 127.0.0.1:8000? What happens when you make the domain:port match the domain:port in your browser address bar exactly?

pfitzsimmons
A: 

The page is not served from anyone it is a "static" one. So how can i do this in an other way?Anyone?

Display Name