Advertisement
thetenfold

GM_xmlhttpRequest-synchronous

Jun 17th, 2013
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. GM_xmlhttpRequest({
  2.     url : "http://www.sometime.com/?results?page=1",
  3.     method : "GET",
  4.     onload : function(res) {
  5.        
  6.         // some code to execute after the first GM_xmlhttpRequest finishes
  7.        
  8.         GM_xmlhttpRequest({
  9.             url : "http://www.sometime.com/?results?page=2",
  10.             method : "GET",
  11.             onload : function(res) {
  12.                
  13.                 // some code to execute after the second GM_xmlhttpRequest finishes
  14.                
  15.                 GM_xmlhttpRequest({
  16.                     url : "http://www.sometime.com/?results?page=3",
  17.                     method : "GET",
  18.                     onload : function(res) {
  19.                
  20.                         // some code to execute after the third GM_xmlhttpRequest finishes
  21.                
  22.                     }
  23.                 });
  24.                
  25.             }
  26.         });
  27.     }
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement