andrew4582

populateTargetFromUrl

Nov 3rd, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function populateTargetFromUrl(c, b) {
  2.     var a;
  3.     try {
  4.         a = new XMLHttpRequest()
  5.     } catch (d) {
  6.         try {
  7.             a = new ActiveXObject("Msxml2.XMLHTTP")
  8.         } catch (d) {
  9.             try {
  10.                 a = new ActiveXObject("Microsoft.XMLHTTP")
  11.             } catch (d) {
  12.                 return false
  13.             }
  14.         }
  15.     }
  16.     try {
  17.         a.onreadystatechange = function () {
  18.             if (a.readyState == 4) {
  19.                 if (a.status == 200) {
  20.                     document.getElementById(b).innerHTML = a.responseText
  21.                 }
  22.             }
  23.         };
  24.         a.open("GET", c, true);
  25.         a.send(null)
  26.     } catch (d) {
  27.         return false
  28.     }
  29. };
Advertisement
Add Comment
Please, Sign In to add comment