How to remove the "and space in my Jquery javascript table (a href Generic Handler)?

1

I have this:

table.append("<tr id='row_" + i + "'><td name='id'>" + "<a href='http://localhost:25429/FileCS.ashx?id='" + Data[i].id  +  " target='_blank'>"  + Data[i].id + "</a></td>"

and send me as an answer:

<a href="http://localhost:25429/FileCS.ashx?id=" 8744="" target="_blank">8744</a>

I need to remove the double quote " between ?id=" 8744 and the +"" between the target, so it looks like this:

<a href="http://localhost:25429/FileCS.ashx?id= 8744 target="_blank">8744</a>

could someone help me? thanks.

    
asked by AraceLi Torres 27.06.2016 в 21:52
source

2 answers

1

Try this

..."<a href='http://localhost:25429/FileCS.ashx?id= " + Data[i].id  +  "' target='_blank'>"  + Data[i].id + "</a></td>"

I modified the answer, I think the fault was that you put the quote ( ') before the value of the id, this should work.

    
answered by 27.06.2016 / 22:08
source
1

Try this

table.append("<tr id=\"row_" + i.toString() + "\"><td name=\"id\">" + "<a href=\"http://localhost:25429/FileCS.ashx?id=\"" + Data[i].id.toString()  +  " target=\"_blank\">"  + Data[i].id.toString() + "</a></td>");
    
answered by 28.06.2016 в 00:06