English 中文(简体)
第一次行使职能后丧失行为能力
原标题:lose a jQuery behavior after first running of function

我有一张桌子,上面有几行和投入。 我希望,每当用户新闻+<>/strong>在文本箱内的关键内容时,添加一条新行。 我可以这样做,但我的问题是,这一职能只是第一次运作。 如果我新闻+是第二个领域的关键,就没有成功。

http://jsfiddle.net/gUjYZ/5/"rel=“nofollow> 这是我在jsFiddle上的法典。

$(document).ready(function(){
    $(".data").bind( keyup ,function(e){
        if(e.which == 107){
            var id = $(this).attr( id );
            var content = $( # +id).val();
            var newContent = content.replace( + ,  );
            $( # +id).val(newContent);

            var current_rows = ($( #myTable tr ).length);
            current_rows = parseInt(current_rows);
            var newId = current_rows + 1;

            var newRow =  <td><input type="text" class="data" id=" +newId+ " /></td> ;
            $( #myTable tr:last ).after(newRow);
            $( # +newId).focus();
        }
    });
    $( #1 ).focus();
});

我必须做些什么?

最佳回答

使用活体而不是约束。 但是,我认为,现在查阅文件已经过时。

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...