$.ajax is not working in Mozilla 3.5 and Chrome2.0

40 views
Skip to first unread message

Asker Ali M

unread,
Aug 20, 2009, 5:25:41 AM8/20/09
to jQuery Accessibility
Hi,
I have developed one sample JQuery, But it is working only in IE7, not
in Mozilla 3.5 and Chrome 2.0,

<html>
<head>
<title>Ajax with jQuery Example</title>
<script type="text/JavaScript" src="jquery.js"></script>
<script type="text/JavaScript">
$(document).ready(function(){
$("#generate").click(ajaxRequest);
});
function ajaxRequest(){
$.ajax({
url: "http://www.w3schools.com/htmL/html_primary.asp",
cache: false,
success: function(html){
alert('Response :\n'+html);
}
});
}
</script>
</head>
<body>
<div id="wrapper">
<div id="quote"><p> Tell me Some thing man......... and Work every
where.........</p></div>
<input type="submit" id="generate" value="Generate!">
<textarea id='responseTEXTAREA' rows='30'></textarea>
</div>
</body>
</html>

In Mozilla and Chrome i am getting the response as zero length but in
IE i am getting the proper data as what the HTML in the URL.

Please suggest me what is wrong with this program.

Regards
Asker Ali M

Nguyen Kha

unread,
Aug 20, 2009, 5:39:09 AM8/20/09
to jquer...@googlegroups.com
I don't know why IE7 could get data! Because you can't make cross-domain request with ajax.
Reply all
Reply to author
Forward
0 new messages