2013-12-19 39 views
-1

我有表中每行包含一個刪除鏈接,並添加鏈接是否存在下表,,,問題是添加一些3行後點擊添加鏈接,然後如果從底部刪除行通過點擊刪除鏈接在每個行...刪除鏈接不工作第二次從底部刪除.....喜歡如果你刪除最後一行,再次如果你再次刪除最新的最後一行然後它顯示400錯誤,,,,可以任何一個我是誰? 我在我的表中刪除如下行功能:如何解決http 400錯誤?

$('#remNew1') 
.live(
    'click', 
function() { 

    var targetId = $('#newfileid').val(); 
var fileName = $("#" + targetId).val(); 
var cnt = parseInt($("#noOfFiles").val()); 
    var agree = confirm("Are you sure? If you choose OK, 
    This Template will be Removed"); 
if (agree) { 
$(this).parent().parent().remove(); 
    $('#listfiles tr').each(function (i) { 
     var index = i + 1; 
     $('td:first .file_name', this).text('File ' + index + ':'); 
    }) 

somethingChanged = true; 
    cnt = cnt - 1; 
$("#noOfFiles").attr("value", cnt); 
if (fileName == undefined) { 
window.location = "files_formulae.htm?projectId=" 
      + $; 
    { 
     project.projectId; 
    }; 
    } 
} else 
    return false; 
}); 


}); 

和我的表如下所示:

<table> 
<td><input type="text" name="name" value="aaa"/></td> 
<a id="remNew1" href="#" class='delete-file'>Delete file</a> 
</td> 
</table> 
<a href="#" id="addNew" class='add-file'>Add additional file</a> 

回答

0

這是由於不正確的語法:

{ 
     project.projectId; 
} 

正確的是:

( 
    project.projectId; 
)