Hallo,
ich habe einen einfachen Off-Line HTML-Editor erstellt.
Wenn ich in der Rubrik JavaScript das Script ändere wird die Änderung erst nach speichern der Seite und einem neuen Aufruf der Seite sichtbar
Ansicht HTML-Editor:
html-seminar.de/woltlab/attachment/1754/
Code:
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EDITOR</title>
<style>
#left000,#right000 {float:left;width:800px;height:800px;border:1px solid black}
#hilfe {display:none}
table {border-collapse:collapse}
table td {border:1px solid #c9c1c1}
</style>
<script>function run(){
//alert ("bingo")
html =document.getElementById("html000").value;
css =document.getElementById("css000" ).value;
javatext =document.getElementById("java000").value;
inhalt=css + html + javatext;
document.getElementById("right000").innerHTML=inhalt;
}
</script>
</head>
<body>
<div id="wrapper000">
<input type="button" onclick="run()" value="Run"><br>
<div id="left000">
<br>CSS<br>
<textarea id="css000" rows="15" cols="95" style="width: 750px; height: 61px;"><style>
#wrapper {border:1px solid black;width:200px;height:200px;background-color:green}
</style>
</textarea>
<br>HTML<br>
<textarea id="html000" rows="15" cols="95" style="width: 759px; height: 69px;"><div id="wrapper">
<input type="button" value="Click mich" onclick="clickmich();">
</div>
</textarea>
<br>Java<br>
<textarea id="java000" rows="15" cols="95" style="width: 756px; height: 71px;"><script>
function clickmich(){
alert("Bingo")}
</script>
</textarea>
</div>
<div id="right000"><style>
#wrapper {border:1px solid black;width:200px;height:200px;background-color:green}
</style>
<div id="wrapper">
<input type="button" value="Click mich" onclick="clickmich();">
</div>
<script>
function clickmich(){
alert("Bingo")}
</script>
</div>
</div>
</body></html>
Alles anzeigen