I write a web site with jquery and many AJAX requests that get data for the table and PHP / Ask the data modifications on MySql Server Side
Currently, I use the ID attribute to store the field ID of the table (which is an exchanged int value). And it works fine. But I have recently learned that the ID should be unique (and start with a letter ...). And I have different tables that can have the same ID value. (For different sql table) I'm not homologous (and xHTML) ... How can I correct my code? Additional Notes: when field elements When I change, an event in the table that asks to modify the server with the correct ID: If you use html 5 Example: This method will also allow you to store JSN objects. and more than your
& lt; span class = "id"> 3 )?
I have written a widget to manage my tables.
To add a new line, I do:
line = $ ('
$ (e.target) .closest (".line") Attr ("id")
data A Are able to or can see more than - * attributes JQuery 1.4.3 will automatically use those data-attributes and put them in the archive on the
.data () element
& lt; Table & gt; & lt; tr data-lineid = "1" & gt; & lt; / tr & gt; will print
1
$ ("tr: first"). Code>
& lt; Table & gt; & Lt; Tr data-line = '{"id": 1, "name": "smith"}' & gt; & Lt; / TR & gt; & Lt; / Table & gt;
data ()
var line = $ ("tr: first"). You can refer to the data ("line") you
row.id and
row.Name
Comments
Post a Comment