2012-09-07 43 views
0

如何補充一點:添加網址爲JavaScript

類型: 「POST」, URL: 「的login.php」,在下面的JS代碼(恰好評論「做你的Ajax調用和處理在這裏... 「:

$(document).ready(function() 
    { 
     $("#submit_butt").click(function() 
     { 
      var conf = 
      { 
       frequency: 5000, 
       spread: 5, 
       duration: 600 
      }; 
     /* do your AJAX call and processing here... 
     .... 
     .... 
     */ 
     // this is the call we make when the AJAX callback function indicates a login failure 
      $("#login").vibrate(conf); 
      // let's also display a notification 
      if($("#errormsg").text() == "") 
      { 
      $("#loginform").append();  
      // clear the fields to discourage brute forcing :) 
      $("#password").val(""); 
      document.forms['login_form'].elements['username'].focus(); 
      } 
      else 
      { 

      } 
     }); 
    }); 

回答

0

更換

/* do your AJAX call and processing here... 
.... 
.... 
*/ 

隨着

$.ajax({ 
type: "POST", 
url: "login.php" 
}); 
+0

您好,我用振動效應的形式登錄。我試着用你的建議代碼,但它仍然不能去login.php。 –

+0

你是什麼意思「不能去login.php」?它根本不發送ajax請求? –

0

添加該代碼爲Ajax處理

$.ajax({ 
    url: "login.php", 
    data: param, 
    success: function(result) { 
     alert('SUCCESS'); 
    } 
}); 
+0

您的login.php應該用引號括起來。 – temporalslide

+0

謝謝!!! @cody – djadmin