私はsencha touch2を初めて使用しています。私はsencha touch2で外部Webサービスを使用したいと考えています。このXMLHttpRequestのようなエラーを与えるコンソールでは、http://localhost/SLS.BRND.Services/Service1.asmx/Helloworld?_dc=1336466078991&method=Helloworld&format=jsonをロードできません。sencha touch2で外部Webサービスを使用する方法
Origin http://localhost:49692 is not allowed by Access-Control-Allow-Origin. app/view/Blog.js?_dc=1336466047687:27Response Status:- 0
問題の原因を教えてください。
Ext.define("GS.view.Blog", {
extend: 'Ext.navigation.View',
xtype: 'blog',
config: {
title: 'WebService',
scrollable: true,
items: [
{
xtype: 'button',
text: 'Press Me',
height: 40,
width: 200,
listeners: {
tap: function() {
// alert("Hi Welcome To Sencha");
Ext.Ajax.request({
method: 'GET',
url: 'http://localhost/SLS.BRND.Services/Service1.asmx/Helloworld',
params: { method: 'Helloworld', format: 'json' },
success: function (response, request) {
alert('Working!')
alert(response.responseText)
console.log('Response:-' + response.responseText)
},
failure: function (response, request) {
alert('Not working!')
console.log('Response Status:- ' + response.status)
}
});
}
}
}
]
}
});
あなたが送信したものと同じコードを使用しましたが、Uncaughtのようなコンソールで同じエラーが発生しました。TypeError:未定義のメソッド 'request'を呼び出せません。 –