|
|
JavaScript Code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
function load(what){ var req = null; try{ req = new XMLHttpRequest(); } catch(ms){ try{ req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(nonms){ try{ req = new ActiveXObject("Microsof.XMLHTTP"); } catch (failed){ req = null; } } } if (req == null) alert("Konnte Ajax nicht initialisieren!"); req.open("GET", "http://akazielx/test/viper/" + what, true); req.onreadystatechange = function(){ switch (req.readyState){ case 4: if (req.status != 200){ alert("Fehler: " + req.status); }else{ document.getElementById("content").innerHTML = req.responseText; } break; default: return false; break; } } req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(null); } |
|
|
Source code |
1 2 3 4 |
Event thread: click Error: Unhandled exception: [Object LSException] code: 81 |
|
|
HTML Code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head> <title>Website der ESD</title> <link rel="stylesheet" href="ajax_style.css" type="text/css" /> <link rel="shortcut icon" href="favicon.ico" /> <script type="text/javascript"> <!-- function load(what){ var req = null; try{ req = new XMLHttpRequest(); } catch(ms){ try{ req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(nonms){ try{ req = new ActiveXObject("Microsof.XMLHTTP"); } catch (failed){ req = null; } } } if (req == null) alert("Konnte Ajax nicht initialisieren!"); req.open("GET", "http://darthd.da.funpic.de/test/viper/" + what, true); req.onreadystatechange = function(){ switch (req.readyState){ case 4: if (req.status != 200){ alert("Fehler: " + req.status); }else{ document.getElementById("content").innerHTML = req.responseText; } break; default: return false; break; } } req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(null); } --> </script> </head> <body onload="load('1.txt')"> <div id="container"> <div id="left"></div> <div id="leftcol"> <div id="menu"> <ul id="menulist"> <li class="top" onclick="load('1.txt')">Eins</li> <li class="ajax" onclick="load('2.txt')">Zwei</li> <li class="ajax" onclick="load('3.txt')">Drei</li> <li class="top" onclick="load('4.txt')">Vier</li> <li class="top" onclick="load('5.txt')">Fünf</li> </ul> </div> </div> <div id="content"> </div> </div> </body> </html> |
This post has been edited 1 times, last edit by "darthdespotism" (Sep 15th 2007, 1:10pm)
This post has been edited 1 times, last edit by "darthdespotism" (Sep 15th 2007, 1:56pm)

This post has been edited 1 times, last edit by "darthdespotism" (Sep 15th 2007, 4:00pm)
This post has been edited 1 times, last edit by "darthdespotism" (Sep 17th 2007, 3:44pm)
|
|
JavaScript Code |
1 |
alert(document.getElementById('deinajaxdiv').parentNode.innerHTML); |
Hm irgendwie seltsam, ich dachte das hatte gepasst, jetzt geht es auf jeden FallKanns sein, dass dein Minimalbeispiel falsch verlinkt ist *g*
Quoted
Wenn du an AjaxInhalte ranwillst, machst du das am besten mit folgendem Snippet:
![]()
JavaScript Code
1 alert(document.getElementById('deinajaxdiv').parentNode.innerHTML);

This post has been edited 1 times, last edit by "darthdespotism" (Sep 17th 2007, 5:11pm)