HiHo,
Hab mir da nun was gebastelt
|
JavaScript Code
|
1
2
3
4
5
6
|
function livesync() {
post_text = document.getElementById('post_text').value;
post_text = post_text.replace(/\n/g,"<br/>");
document.getElementById('previewBox').innerHTML = post_text;
}
|
|
HTML Code
|
1
2
3
4
5
|
<div id="previewBox">
</div>
<textarea name="post_text" id="post_text" onKeyUp="livesync();" style="min-height:300px; min-width:700px;" class="bbctxtarea" ></textarea>
|
Wenn ich jetzt allerdings teile deines Codes anpasse und einfüge
|
JavaScript Code
|
1
2
|
post_text=post_text.replace(/[b]/g, "<strong>");
post_text=post_text.replace(/[/b]/g, "</strong>");
|
und ich habe im textfeld stehen
test
erhalte ich als livevorschau folgende ausgabe
[]test[] <r>
Was läuft da schief?