Fehler beim Nachladen von HTML-Snippets
Hi alle zusammen,
Ich hab ein seltsames Problem, ich lasse mir in dem Mainbereich meiner Seite HTML-Snippets nachladen.
Dazu nutze ich das dojo toolkit, was auch bisher gut klappt.
|
HTML Code
|
1
2
|
<div id="main">
</div> <div id="navi"> <ul> <li><a id="home">Home</a></li> <li><a id="pro">Produkte</a></li> <li><a id="faq">FAQ Produkte</a></li> <li><a id="log">Login</a></li> <li><form> <p>suchen <input name="search" size="15"></p> </form></li> </ul> </div>
|
bei dem Login wird diese Seite nachgeladen:
|
HTML Code
|
1
|
<div id="content"> Sie sind noch nicht registiert?<br> Melden Sie sich <a id="regist">HIER</a> kostenlos an. </div>
|
Nun will ich dort wieder ein weiteres Element nachladen.
Und da trat der Fehler auf. Er lädt jetzt nur noch das eine Element mit der ID= regist nach,
unabhängig welchen Bereich ich anklicke.
Hier mal das Script:
|
JavaScript Code
|
1
2
3
4
5
6
7
8
9
10
|
/*Dojo*/
dojo.addOnLoad(function() {
dojo.connect(dojo.byId('home'), 'onclick', function(e) { e.preventDefault(); dojo.xhrGet({ url: "home.html", load: function (newContent){ dojo.byId("main").innerHTML = newContent; } }); });
dojo.connect(dojo.byId('log'), 'onclick', function(e) { e.preventDefault(); dojo.xhrGet({ url: "login.html", load: function (newContent){ dojo.byId("main").innerHTML = newContent; } }); });
dojo.connect(dojo.byId('regist'), 'onclick', function(e) { e.preventDefault(); dojo.xhrGet({ url: "reg.html", load: function (newContent){ dojo.byId("main").innerHTML = newContent; } }); });
dojo.connect(dojo.byId('con'), 'onclick', function(e) { e.preventDefault(); dojo.xhrGet({ url: "contact.html", load: function (newContent){ dojo.byId("main").innerHTML = newContent; } }); });
dojo.connect(dojo.byId('imp'), 'onclick', function(e) { e.preventDefault(); dojo.xhrGet({ url: "impressum.html", load: function (newContent){ dojo.byId("main").innerHTML = newContent; } }); }); });
|
Ich hab keine Ahnung woran das liegen könnte und hoffe das ihr mir da helfen könnt
Gruß
nobody
Edit: das bei mir nie die codes innerhalb der syntax richtig dargestellt werden können -.-
This post has been edited 1 times, last edit by "nobody special" (Jan 18th 2012, 4:06pm)