Widget:Letzte Aktivität

Aus FürthWiki

Version vom 4. Juni 2015, 09:47 Uhr von Red Rooster (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „<script type="text/javascript"> function createRequestObject() { var obj; var browser = navigator.appName; if (browser == "Microsoft Internet Expl…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

<script type="text/javascript">

function createRequestObject() {

   var obj;
   var browser = navigator.appName;
   if (browser == "Microsoft Internet Explorer") {
       obj = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
       obj = new XMLHttpRequest();
   }
   return obj;

}

function sendReq(req) {

   var http = createRequestObject();
   http.open('get', req);
   http.onreadystatechange = handleResponse;
   http.send(null);

}

function handleResponse() {

   if (http.readyState == 4) {
       var response = http.responseText;
       document.getElementById('setADivWithAnIDWhereYouWantIt').innerHTML=response;
   }

}

sendReq('yourpage');

//previously </script> was not visible </script>