Bonjour !
Voici mes scripts:
D'un côté, déjà présent dans le html .. dans une classe X j'ai
Code Javascript :
prepair: function() {
js = new Element('script', {'src': this._script, 'type':'text/javascript'});
H().appendChild(js);
},
run: function() {
this.prepair();
this._handler = new npcscript(this);
this._handler.run();
},
On voit que dans ce morceau, quand run() est appellée, cela ajoute un script à H() (qui est simplement <head>)
Voila, j'essaye de chargé un script nommé 1.js
Contenu:
Code Javascript :
npcscript = Class.create();
npcscript.prototype.initialize = function(parent) {
var npc = this, cm = parent;
var html = [];
};
npcscript.prototype.run = function() {
alert('hi');
};
npcscript.prototype.close = function() {
cm.close();
};
J'ai vérifié, l'ajout du script à <head> se fait normalement, mais mon script bloque sur ..
this._handler = new npcscript(this);
Comment faire pour fixer cette erreur ? :(