javascript - Button renders as simple text when add programmatically inside table cell -


I am trying to add dynamic row to table (last TD cell has a button)

When I see the row generated with firebugs in Firefox like I

   

But it has not been presented as a button, like a simple button (not clickable, there is no border around). I make a line in JS

  var rowContent = '& lt; Tr valign = "middle" & gt; & Lt; Td square = "center_details" & gt; & Lt; A data-role = "button" Class = "custom-button" name = "drag_req" data-name = "'+ responseData [' id '] +'" gt; Drag & lt; / A & gt; & Lt; / Td> & Lt; / Tr & gt; '; $ ('# My_data_requests' tabs: last'). Html (Line Resource);  

(The response data is a dictionary with all keys to be used) When I make the same HTML in the template, then drag it like drag buttons do not have simple text. Does anyone know what is wrong?

This could be due to single quotes in response code ['id'] ? Those string may be messed up, I will declare var different so that there is no single quotation mark in the row.

  var responseData_id = responseData ['id']; Var rowContent = '& lt; Tr valign = "middle" & gt; & Lt; Td class = "center_vertical" & gt; & Lt; A data-role = "button" class = "custom-button" name = "drag_req" data-name = "'+ ResponseData_id +'" & gt; Drag & lt; / A & gt; & Lt; / Td> & Lt; / Tr & gt; '; $ ('# My_data_requests' tabs: last'). Html (Line Resource);  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -