Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. series = new Object();
  2. $(xml_node).find("Series").each(function (i) {
  3. series["id" + i] = $(this).find("seriesid").text();
  4. series["name" + i] = $(this).find("SeriesName").text();
  5. series["banner" + i] = $(this).find("banner").text();
  6. table += '<tr<td>' + series["banner" + i] + '</td>' + '<td>' + series["name" + i] +
  7. '</td>' + '<td>' + '<button>Add show</button>' + '</td>' + '</tr>';
  8. });
  9. $('button').click(function addseries() {
  10. $.ajax({
  11. type: "POST",
  12. url: 'write.php',
  13. data: series["id" + i],
  14. success: function (data) {
  15. console.log(data);
  16. }
  17. });
  18. });
  19.  
  20. ...'<button data-id="' + i +'">Add show</button>'..
  21.  
  22.  
  23. $('button').click(function addseries(e){
  24. var i = $(e.currentTarget).attr('data-id');
  25. $.ajax({
  26. type: "POST",
  27. url: 'write.php',
  28. data: i,
  29. success: function(data) {
  30. console.log(data);
  31. }
  32. });
  33.  
  34. data: {id: i}
  35.  
  36. data: 'id=' + i
  37.  
  38. $('button').click(function addseries(e){
  39. console.log($(e.target));
  40. }
  41.  
  42. $('button').click(function addseries(e){
  43. console.log( $(this).attr('id') );
  44. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement