Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. function pre() {
  2. $.ajax({
  3. url: "arquivo1.php",
  4. method: 'POST',
  5. dataType: 'json',
  6. success: function (data) {
  7. $.ajax({
  8. url: "arquivo2.php",
  9. method: 'POST',
  10. dataType: 'json',
  11. success: function (data2) {
  12.  
  13. $.each(data.id, function(i, item) {
  14.  
  15. $( ".lado" ).prepend("<div id='" + data.id + "'><select class='select'></select></div>");
  16.  
  17. if (data.id == data2.id) {
  18. $( ".select" ).append("<option'>" + data2.id + "</option>");
  19. }
  20. });
  21.  
  22. }
  23. });
  24. }
  25. });
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement