Hallo,
ich versuche gerade folgendes script in meine Komponente einzubauen.
Grundsätzlich ist der code egal. Nur - das einbinden an sich funktioniert nicht.Code:<!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></title> <meta **********="Content-Type" content="text/html; charset=iso-8859-1" /> <script src="../js/moo1.2.js" type="text/javascript"></script> <script type="text/javascript"> var anzahlAntworten = 1; function addAntwort() { anzahlAntworten ++; id = anzahlAntworten; var myAnchor = new Element('div', { 'class': 'antwort', 'id': 'antwort-' + id, 'html': '<label for="antwort-' + id + '">Antwort ' + id + '</label><input type="text" value="" name="antwort[]"/><a href="#" onclick="removeAntwort(' + id + ')">Löschen (id: '+id+')</a>' }).inject($('antworten')); resetLable (); } function removeAntwort(id) { $('antwort-' + id).dispose(); resetLable (); } function resetLable (){ $$('.antwort').each(function(el, i){ ellable = el.getElement('label'); ellable.innerHTML = 'Antwort ' + (i+1); }); } </script> </head> <body> <form> <div id="antworten"> <div class="antwort" id="antwort-1"> <label for="antwort-1">Antwort 1</label><input type="text" value="" name="antwort[]"/><a href="#" onclick="removeAntwort(1)">Löschen (id: 1)</a> </div> </div> <a onclick="addAntwort()">Antwort hinzu</a> </form> </body> </html>
Also ich habe ja eine php file. Diese enthält allerdings keinen head title usw..
Jetzt stellt sich mir die Frage, wo muss ich den script teil unterbringen?
Habe es schon in der index.php der template versucht, aber das script hat nicht funktioniert.
Weis da jemand vielleicht Bescheid?


LinkBack URL
About LinkBacks
Zitieren

Lesezeichen