Jquery bring a space next murder

Due to the dynamic form filling line, so I used the append (text) function in jquery, beautiful layout for the code, which I joined in the appropriate spaces, and therefore lead to a tragedy.

$("#tableId").append(" <tr><td>&nbsp;</td></tr> ");

The above statement work properly in IE8, Chrome and other browsers, but not correct in IE6, click Add row is invalid, did not prompt an error.

Around in a big circle, I checked a lot of places, even jquery upgrade to the latest version can not solve the problem.

It was accidentally inside the code for the layout of spaces removed, a miracle just happened, problem solving, really pit father ah.

The correct code is: 

 $("#tableId").append("<tr><td>&nbsp;</td></tr>");


Reproduced in: https: //www.cnblogs.com/baoposhou/archive/2011/11/22/2258689.html

Guess you like

Origin blog.csdn.net/weixin_34240657/article/details/93320773