คือ ตอนนี้ผมทำ App PushNotification ด้วย Phonegap ครับ แล้วผมต้องการส่ง RegisterID ไปเก็บไว้ใน Database(SQLSERVER) ผ่าน Web Service(Asp.net) แต่ติดปัญหาทีตรง พอ Test ผ่าน Mobile ทำให้ไม่สามารถ ใช้ Ajax Call Web service มาได้ครับ Call ได้เฉพาะ Localhost แต่พอ Call ผ่าน IP ไม่ได้ครับ
นี่คือโค๊ดครับ ผมหาข้อมูลมาน่าจะเกี่ยวกับ CrossDomain ครับ แต่ติดตรงที่ผมไม่รู้จะทำยังไงนี่แหละครับ
$.ajax({
url :"
http://192.168.1.35:8081/Service/Service/WebService.asmx/Insert",
type: 'POST',
data: "PhoneNo="+PhoneNumber+"&RegID="+RegisID+"",
crossDomain: true,
dataType: "text",
success: function (data) {
alert(data); // show the string that was returned, this will be the data inside the xml wrapper
} });
สอบถามปัญหา Ajax CrossDomain
นี่คือโค๊ดครับ ผมหาข้อมูลมาน่าจะเกี่ยวกับ CrossDomain ครับ แต่ติดตรงที่ผมไม่รู้จะทำยังไงนี่แหละครับ
$.ajax({
url :"http://192.168.1.35:8081/Service/Service/WebService.asmx/Insert",
type: 'POST',
data: "PhoneNo="+PhoneNumber+"&RegID="+RegisID+"",
crossDomain: true,
dataType: "text",
success: function (data) {
alert(data); // show the string that was returned, this will be the data inside the xml wrapper
} });