Di seguito è il codice per il mio YWA involucroPerché chrome lancia qui "Errore non rilevato: NOT_FOUND_ERR: DOM Exception 8"?
var astr_ywascript = (document.createElement("script").type = "text/javascript").src = "http://d.yimg.com/mi/eu/ywa.js";
document.head.appendChild(astr_ywascript); // <- error on this line
È gestito al caricamento della pagina, quindi non ha senso che JS non riesce a trovare il tag del documento testa.
Qualche idea?
Grazie
Opera getta questo errore sulla stessa linea. Uncaught exception: Error: WRONG_ARGUMENTS_ER
Firebug dice: document.head is undefined [Break On This Error] document.head.appendChild(astr_ywascript);
.el è il riferimento di Backbone all'elemento che viene aggiornato da render(). Probabilmente hai "return this;" nel tuo metodo render(), che restituisce un riferimento alla Backbone View stessa, quando suona come ti aspettavi "return this.el' che ti permetterebbe di fare' $ (...) .html (@ view.render()) ' –
Questo commento mi ha appena risolto un enorme mal di testa! Sarei interessato a sapere perché la convenzione è di "restituire questo" dalla funzione di rendering anziché restituire this.el? – garmur
Stavo ottenendo lo stesso problema quando si passa un array alla funzione .append(). Invece di passare un semplice testo html ho passato ** un array ** di testo html e questo ha reso il problema possibile. – userfuser