[問題] form表單沒有action 是怎麼回事呢?
最近接手網頁專案,但看到form表單沒有action,
請問該如何知道按下submit後表單是呼叫什麼方法呢?
謝謝。
<form class="form-signin" id="form-signin" role="form">
.
.
省略
.
.
<button type="submit" class="btn btn-lg btn-danger btn-block ladda-button"
data-style="expand-left">Sign In</button>
</form>
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.169.207.174
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1519041672.A.FD0.html
→
02/19 20:20,
7年前
, 1F
02/19 20:20, 1F
→
02/19 20:20,
7年前
, 2F
02/19 20:20, 2F
→
02/19 20:21,
7年前
, 3F
02/19 20:21, 3F
→
02/19 20:21,
7年前
, 4F
02/19 20:21, 4F
→
02/19 20:21,
7年前
, 5F
02/19 20:21, 5F
推
02/19 22:15,
7年前
, 6F
02/19 22:15, 6F
→
02/20 01:33,
7年前
, 7F
02/20 01:33, 7F
→
02/20 19:29,
7年前
, 8F
02/20 19:29, 8F
→
02/20 19:29,
7年前
, 9F
02/20 19:29, 9F
→
02/20 19:32,
7年前
, 10F
02/20 19:32, 10F
→
02/20 19:32,
7年前
, 11F
02/20 19:32, 11F
用x大的方法找到一個.js檔,
其中有個ajax內容是…
$.ajax({
url: curl,
type: 'POST',
data: $form.serialize(),
dataType:"json",
success: function(r) {
if(r.ok=='1') document.location=r.redirect;
else {
$('#form-signin input[name="pass"]').val('');
if(r.user!='') fv.updateMessage('user', 'blank',
r.user).updateStatus('user', 'INVALID', 'blank');
if(r.pass!='') fv.updateMessage('pass', 'blank',
r.pass).updateStatus('pass', 'INVALID', 'blank');
}
}
});
找到curl變數,確認了方法為index_ajax,
後來又發現https://imgur.com/a/NUOMv,
找不到方法,看來是路徑錯了!!
目前index_ajax方法是位於controller資料夾下的Login.php檔,
我該如何讓Login.php的index_ajax方法符合路徑呢?
專案是用xampp,php後端的程式碼,謝謝。
※ 編輯: james999 (1.169.207.174), 02/20/2018 20:59:14
問題已解決了,修改.htaccess內定義的路徑。
Options -Indexes
RewriteBase
謝謝各位解惑^^
※ 編輯: james999 (1.169.207.174), 02/21/2018 00:55:56
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章