Advertisement
Guest User

Untitled

a guest
Jul 10th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1.  
  2. function selectFemales(){
  3. //alert('here');
  4.  
  5. $.ajax({
  6. type: "POST",
  7. url: "http://localhost:60284/WebService.asmx/GetFemaleDogsDS",
  8. data: "{}",
  9. beforeSend:function(){
  10. // this is where we append a loading image
  11. $('#dogs').html('<div class="loading"><img src="/images/loading.gif" alt="Loading..." /></div>');
  12. },
  13. success: OnSuccess,
  14. error: OnError
  15.  
  16. });
  17. }
  18.  
  19.  
  20. function OnSuccess(data, status) {
  21.  
  22.  
  23. $('#dogs').empty();
  24.  
  25.  
  26.  
  27. $(data).find('Table').each(function(i){
  28. var listView = $('<ul data-role="listview" data-split-theme="d" ui-li-icon="http://assets.dogtime.com/breed/profile/thumbnail/4d3771940106195669001608/square_80_golden-retriever.gif">').data('role', 'listview');
  29.  
  30. $(data).find('Table').each(function(){
  31. var title = $(this).find('ShortDesc').text();
  32. var description = $(this).find('LongDesc').text();
  33. var thumbnail = $(this).find('ThumbURL').text();
  34. var listItem = $('<li/> ');
  35.  
  36. $('<img src=thumbnail)></img><h4 />').text(title).appendTo(listItem);
  37. $('<p />').html(description).appendTo(listItem);
  38.  
  39.  
  40. $(listItem).appendTo(listView);
  41. });
  42.  
  43. $(listView).appendTo('#dogs');
  44. });
  45.  
  46.  
  47. $('#dogs ul').listview();
  48.  
  49.  
  50.  
  51.  
  52. }
  53.  
  54. function OnError(request, status, error) {
  55. alert('efffme');
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement