2012-10-09 30 views

回答

1

您不應在URL中發送password

如果你想通過其他一些細節:更新這兩行,如下:

   data: {data1:$("input#data1").val(),data2:$("input#data2").val()}, 
      url: "http://localhost:53179/hdfcmobile/hdfc.ashx", 
+0

如何傳遞方法名稱? – user751828

+0

你的意思是類型。如果是的話,你已經寫了 - 輸入:'POST', –

0

,如果你想通過URL參數時,要使用:

type: 'GET' 

也:

url: 'http://localhost:53179/hdfcmobile/hdfc.ashx 

進入阿賈克斯CONFIGS,使用類型爲: 'POST' 將張貼字段插入頭部,而不是網址。

0

試試下面的代碼:

你可以嘗試這種模式你的代碼...

var sdate = $('#banners_startdate').val(); 

var edate = $('#banners_enddate').val(); 

     if(sdate != '' && edate != ''){ 
      $.ajax({ 
       url: 'your url', 
       data: 'apiname=get_banner_stat_platform_sharing&var=bannerstats&sdate=' + sdate + '&edate=' + edate, 
       dataType: 'html', 
       success: function(data){ 
             $('#bannerstats').html(data); 
              return false; 
             } 
      }); 
     } 
0

用戶名和密碼可以通過編號獲取

function ajaxcall(username,password) 
    { 
     jQuery.ajax({ 

         type: "POST", 

         url: "Enter Url to pass", 

         data: {user: username, pass: password}, 

         dataType: "html", 

         success: function(data) { 
//write code what you want to do here 
            } 

        }); 

    } 

您可以通過只$_POST['user']$_POST['pass']

感謝