2010-06-10 76 views
-1
$.ajax({ 
      type: "GET", 
      url: 'http://services.somewhere.com/MethodName', 
      data: { 'param1':'something', 'param2': 'somethingElse' }, 
      cache: false, 
      dataType: 'jsonp', 
      contentType: "application/json; charset=utf-8", 
      success: function(view) { 
       alert('success'); 
      }, 
      error: function(xhr, ajaxOptions, thrownError) { 
       alert(xhr.status); 
       alert(xhr.responseText); 
       alert(xhr.statusText); 
      } 
     }); 
+3

**什麼是不工作**?你會得到什麼錯誤?錯誤消息存在的原因:) – 2010-06-10 14:11:44

+0

有沒有在Firefox中的錯誤,或者可能使用類似螢火蟲跟蹤請求和/或驗證的JavaScript錯誤? – 2010-06-10 14:12:19

回答

0

終於找到了解決方案here這顯然清楚地說明了如何使用Web服務

相關問題