jquery错误发送消息

时间:2010-09-14 06:01:39

标签: jquery

当jquery运行时,这不是“成功”,这是在“错误”部分。我的php文件在另一个server.code就像下面。

  $(document).ready(function() {  

    //if submit button is clicked  
    $('#recaptcha_reload').click(function () { 
   var data ="publick="+document.getElementById("publickeyval").value+"&privatek="+document.getElementById("privatekeyval").value;

 alert(data);
//start the ajax  
      $.ajax({

           //this is the php file that processes the data and send mail  
           url: "http://www.example.com/example_api/example_adcpatchaapi.php",   

           //GET method is used  
           type: "GET",  

           //pass the data           
           data: data,       

           //Do not cache the page  
           cache: false,  

           //success  
           success: function (html) { 
alert(html);

               if (html) {      

document.getElementById('captcha_table').innerHTML=html;    


               }    else{
      alert("####");  // runing this alert box
 }
           },
    error : function(XMLHttpRequest, textStatus, errorThrown) {
            alert(XMLHttpRequest.status); // showing 0 
        }      
       });  

       //cancel the submit button default behaviours  
       return false;  
   });   

});

2 个答案:

答案 0 :(得分:1)

很抱歉,相同的origin policy苹果,您无法使用AJAX访问当前域/服务器之外的页面

答案 1 :(得分:0)

相关问题