- 主题:遇到诡异问题了(JQuery)
按钮可以正确提交,但是<a>的连接怎么都提交不了,何解?
$(function() {
$('#submit').button().click(function() {
$('#action').val('add');
$('#commentform').submit();
});
$('a#comment-delete').click(function(){
$('#action').val('delete');
$('#key').val($(this).attr('title'));
$('#commentform').submit();
});
});
<a id="comment-delete" href="#" title="9">Delete</a>
<form action="/comment" method="post" id="commentform">
<input type="hidden" name="action" id="action"/>
<input type="hidden" name="key" id="key"/>
。。。。
<button id="submit">Submit Comment</button>
</form>
--
修改:neek2000 FROM 221.223.85.*
FROM 221.223.85.*
jq + html 打包发过来看看。。
【 在 neek2000 (泥壳¥努力赚钱) 的大作中提到: 】
: 按钮可以正确提交,但是<a>的连接怎么都提交不了,何解?
: $(function() {
: $('#submit').button().click(function() {
: ...................
--
FROM 123.113.109.*
页面后面的程序一堆。。。
呵呵,换了种恶心的方法搞定了
【 在 shaolin (叶孤城|漫漫当爹路) 的大作中提到: 】
: jq + html 打包发过来看看。。
--
FROM 221.223.85.*
【 在 neek2000 (泥壳¥努力赚钱) 的大作中提到: 】
: 标 题: 遇到诡异问题了(JQuery)
: 发信站: 水木社区 (Sun Mar 14 15:13:27 2010), 站内
:
: 按钮可以正确提交,但是<a>的连接怎么都提交不了,何解?
:
: $(function() {
: $('#submit').button().click(function() {
: $('#action').val('add');
: $('#commentform').submit();
: });
:
: $('a#comment-delete').click(function(){
click(fucntion(e) {
e.preventDefault();
: $('#action').val('delete');
: $('#key').val($(this).attr('title'));
: $('#commentform').submit();
: });
: });
:
: <a id="comment-delete" href="#" title="9">Delete</a>
:
: <form action="/comment" method="post" id="commentform">
: <input type="hidden" name="action" id="action"/>
: <input type="hidden" name="key" id="key"/>
: 。。。。
: <button id="submit">Submit Comment</button>
: </form>
:
: --
:
: ※ 修改:·neek2000 于 Mar 14 15:15:35 2010 修改本文·[FROM: 221.223.85.*]
: ※ 来源:·水木社区 newsmth.net·[FROM: 221.223.85.*]
--
修改:neek2000 FROM 221.223.85.*
FROM 123.127.65.*