Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- series = new Object();
- $(xml_node).find("Series").each(function (i) {
- series["id" + i] = $(this).find("seriesid").text();
- series["name" + i] = $(this).find("SeriesName").text();
- series["banner" + i] = $(this).find("banner").text();
- table += '<tr<td>' + series["banner" + i] + '</td>' + '<td>' + series["name" + i] +
- '</td>' + '<td>' + '<button>Add show</button>' + '</td>' + '</tr>';
- });
- $('button').click(function addseries() {
- $.ajax({
- type: "POST",
- url: 'write.php',
- data: series["id" + i],
- success: function (data) {
- console.log(data);
- }
- });
- });
- ...'<button data-id="' + i +'">Add show</button>'..
- $('button').click(function addseries(e){
- var i = $(e.currentTarget).attr('data-id');
- $.ajax({
- type: "POST",
- url: 'write.php',
- data: i,
- success: function(data) {
- console.log(data);
- }
- });
- data: {id: i}
- data: 'id=' + i
- $('button').click(function addseries(e){
- console.log($(e.target));
- }
- $('button').click(function addseries(e){
- console.log( $(this).attr('id') );
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement