daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest May 17th, 2018 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. GET http://localhost:8080/socket.io/?EIO=2&transport=polling&t=1409325689935-6 net::ERR_CONNECTION_REFUSED
  2.    
  3. socket = io.connect(document.domain, {
  4.     'sync disconnect on unload' : false
  5. });
  6.    
  7. <script type="text/javascript" onload="loaded()" src="get_socket.js"></script>
  8.  
  9. function loaded(){
  10.  
  11. //this will only execute if the server is up
  12.  
  13. }
  14.    
  15. var load,execute,loadAndExecute;
  16. load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},
  17. execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},
  18. loadAndExecute=function(a,b,c){return load(a,function(){return execute(b)},function(){return c();})};
  19.    
  20. loadAndExecute("domain.com:80/socket.io/socket.io.js", function() {
  21.     //it loaded, put main code here
  22. },
  23. function(){
  24.     //failed to load, put error display code here
  25. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top