我正在尝试访问 jquery 函数中的 post 目标操作。
例子:
<form action="/page/users" id="signup" method="post">
在这种情况下,我想访问“操作”部分 - “/page/users”。
$('#signup').live("submit", function(event) {
// get this submitted action
}
似乎我遗漏了一些非常简单的东西。我在 dom 中看到了值,但不知道它存储在 jquery 中的什么位置。
谢谢!
最佳答案
$('#signup').on("submit", function(event) {
$form = $(this); //wrap this in jQuery
alert('the action is: ' + $form.attr('action'));
});
关于jquery 获取 Action 后 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2550620/