jQuery.append function gives me NaN at the end
I have written some simple jquery code :
function Generate(result, counter) {
$("#ArchivesContent").append(
"<table width='100%'>" +
"<tr>" +
"<td width='20%'>" +
"<a class='A_archClass' href='detailsDocument.aspx?id=" + result.d[counter].ID + "'>"
+ result.d[counter].Date +
"</a>" +
"</td>" +
"<td width='20%'>" +
"<a href='detailsDocument.aspx?id=" + result.d[counter].ID + "'>" + result.d[counter].Title + "</a>" +
"</td>" +
"<td width='60%'>" +
"<img style='width:100px;height:136px;' alt='' src='" + result.d[counter].Image.replace("~/", "") + "' />" +
"</td>" +
"</tr>" +
"</table>" +
+"<开发者_C百科hr />"
);
}
I use visual studio to debug my jquery code it works every thing is fine but at the end of the "< / table>" tag insert and show "NaN" value this function is repeat once.
Maybe this part has something to do with it:
"</table>" +
+"<hr />"
Yes, you typed additional plus (the second plus is considered as a positive sign that expects a number). You shall replace with "" + "
".
精彩评论