einfügen von html in div mit javascript

Ich habe ein Problem bei der Aktualisierung einer div mit javascript.

<script>
document.getElementById('advertisingBrandValues').innerHTML = "<p>The Mac is the most powerful   creative tool in the world, giving users unbridled potential to make everything from     bespoke family albums to industry-standard pop songs – iCreate is the key to unlocking that potential. Accessible, smart and authoritative, the iCreate brand thrives on the mantra ‘instruct, inform, inspire’, helping thousands of Mac users realise their creative ambitions.</p>";                   

</script>

<div id="advertisingBrandValues"></div>

Ich erhalte immer folgende Fehlermeldung:

unterminated string literal
und es zeigt, dass der Fehler mit dem ersten P-tag

Brauche ich, wenn ich etwas ot das HTML, das leite ich in die innerHTML-Funktion?

Vielen Dank im Voraus!

  • Keine Probleme auf Safari, im Gegensatz zu manchen anderen Quatsch mit der Phantasie-Symbole.
InformationsquelleAutor richelliot | 2012-09-17
Schreibe einen Kommentar