|
Last change
on this file since 7821 was 7718, checked in by janveeden, 16 years ago |
|
gebruikers/beheerdersview switch now works for node_info.php.
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | var xmlhttp;
|
|---|
| 2 | var obj = "infotop";
|
|---|
| 3 | //Switch to gebruiker view
|
|---|
| 4 | function switchGebruiker(){
|
|---|
| 5 | var url = 'inc/node_info.php?view=gebruiker';
|
|---|
| 6 | loadXMLDoc(url);
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | //Switch to beheerder view
|
|---|
| 10 | function switchBeheerder(){
|
|---|
| 11 | var url = 'inc/node_info.php?view=beheerder';
|
|---|
| 12 | loadXMLDoc(url);
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | //Code from w3schools. http://www.w3schools.com/dom/dom_http.asp
|
|---|
| 16 | function loadXMLDoc(url)
|
|---|
| 17 | {
|
|---|
| 18 | xmlhttp=null;
|
|---|
| 19 | if (window.XMLHttpRequest)
|
|---|
| 20 | {// code for Firefox, Opera, IE7, etc.
|
|---|
| 21 | xmlhttp=new XMLHttpRequest();
|
|---|
| 22 | }
|
|---|
| 23 | else if (window.ActiveXObject)
|
|---|
| 24 | {// code for IE6, IE5
|
|---|
| 25 | xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|---|
| 26 | }
|
|---|
| 27 | if (xmlhttp!=null)
|
|---|
| 28 | {
|
|---|
| 29 | xmlhttp.onreadystatechange=state_Change;
|
|---|
| 30 | xmlhttp.open("GET",url,true);
|
|---|
| 31 | xmlhttp.send(null);
|
|---|
| 32 | }
|
|---|
| 33 | else
|
|---|
| 34 | {
|
|---|
| 35 | alert("Your browser does not support XMLHTTP.");
|
|---|
| 36 | }
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | function state_Change()
|
|---|
| 40 | {
|
|---|
| 41 | if (xmlhttp.readyState==4)
|
|---|
| 42 | {// 4 = "loaded"
|
|---|
| 43 | if (xmlhttp.status==200)
|
|---|
| 44 | {// 200 = "OK"
|
|---|
| 45 | document.getElementById(obj).innerHTML=xmlhttp.responseText;
|
|---|
| 46 | }
|
|---|
| 47 | else
|
|---|
| 48 | {
|
|---|
| 49 | alert("Problem retrieving data:" + xmlhttp.statusText);
|
|---|
| 50 | }
|
|---|
| 51 | }
|
|---|
| 52 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.