我有http://mysite.com:8086/project/的Grails:JavaScript集成
ApiController Grails的服務器渲染(在我的情況的HTML代碼)一些文本http://mysite.com:8086/project/api/lastorders
我有另一臺服務器http://othersite.net/ - 這是用HTML頁面簡單的Apache服務器。
我想顯示從我的頁面上的服務器返回的文本。
我已經試過:
<script type="text/javascript">
new Ajax.Request("http://mysite.com:8086/project/api/lastorders", {
method: 'get',
onSuccess: function(response){
alert(response.responseText);
},
onFailure: function(){
alert('ERROR');
}
});
</script>
,但反應是空的...