jQuery.get未接收数据
我有以下html+jquery:jQuery.get未接收数据,jquery,ruby-on-rails,rest,Jquery,Ruby On Rails,Rest,我有以下html+jquery: <body> <head> <script type="text/javascript" src="jquery.js"></script> <script> $(window).load(function() { $('#test').bind('click', functi
<body>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(window).load(function() {
$('#test').bind('click', function() {
$.get("http://localhost:3000/promotions.xml", function(data){
alert("Data Loaded: " + data);
});
});
});
</script>
</head>
<input id="test" type="button" value="Testando">
</body>
所以我想我缺少的是javascript/jQuery中的一些东西。我正在使用jquery1.4.4。出什么问题了?我猜这是由于,这要求AJAX请求与页面的源位置相同 如果页面不是从
localhost:3000
托管的,则会违反策略
如果您正在使用Chrome进行测试,您应该能够通过以下方式从终端应用程序启动安全策略来禁用安全策略:
--disable-web-security
--disable-web-security