No responding of request from client to server
I try to make a request from client to server using Jquery and Ajax, but it doesn't work. I even tried Ajax and Xml, but still not working. Can somebody help 开发者_如何学编程me for this issue ? Here is my code. For sure that jquery-1.6.2.js is on same directory than .html file, also client and server are connected at same internet network.
Thanks.
<html>
<head>
<script type="text/javascript" src="jquery-1.6.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("div").load('http://myIPserver/isrhiproxy/isr_stm_info.aspx?requestType=101&query=20110823;1435;53173;any;139;n');
});
});
</script>
</head>
<body>
<div>Horaire Bus 139</div>
<button>Voir</button>
</body>
</html>
You have an absolute URI which suggests you are trying to violate the same origin policy about which there are many questions and answers already.
You can make an ajax request to a .php script on same server that does the cross domain request for you and returns the result. Look up cURL.
As Quentin has explained why you are not getting the response what you can do is make a server side proxy send an ajax request to your proxy. The proxy will in-turn call the web service you are trying to access and return the response to your ajax call. Here is an example Ajax not working with wunderground API (A Weather service to get information and display)
精彩评论