source: trunk/src/map/inc/gebruiker_beheerder_switch.js@ 7841

Last change on this file since 7841 was 7829, checked in by janveeden, 15 years ago

Switching now works in IE. Was a caching problem in gebruiker_beheerder_switch.js.

File size: 1.1 KB
Line 
1var xmlhttp;
2var obj = "infotop";
3//Switch to gebruiker view
4function switchGebruiker(){
5 var url = 'inc/node_info.php?view=gebruiker'+"&a="+Math.random();
6 loadXMLDoc(url);
7}
8
9//Switch to beheerder view
10function switchBeheerder(){
11 var url = 'inc/node_info.php?view=beheerder'+"&a="+Math.random();
12 loadXMLDoc(url);
13}
14
15//Code from w3schools. http://www.w3schools.com/dom/dom_http.asp
16function loadXMLDoc(url)
17{
18xmlhttp=null;
19if (window.XMLHttpRequest)
20 {// code for Firefox, Opera, IE7, etc.
21 xmlhttp=new XMLHttpRequest();
22 }
23else if (window.ActiveXObject)
24 {// code for IE6, IE5
25 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
26 }
27if (xmlhttp!=null)
28 {
29 xmlhttp.onreadystatechange=state_Change;
30 xmlhttp.open("GET",url,true);
31 xmlhttp.send(null);
32 }
33else
34 {
35 alert("Your browser does not support XMLHTTP.");
36 }
37}
38
39function state_Change()
40{
41if (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.