Som overskriften siger så virker min wysiwyg ikke, man kan godt skrive i den, men man kan ikke lave
fed,
kursiv,
Understreget og forskellige tekst størelser, min koder er:
<!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=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
<title>WYSIWYG Editor</title>
<script type="text/JavaScript">
var editor;
function init()
{
editor = document.getElementById("editor");
editor.contentWindow.document.designMode = "On";
}
function txtCommand(command, value)
{
editor.contentWindow.document.execCommand(command, false, value);
}
function NormalMode()
{
editor.contentWindow.document.body.innerHTML = document.getElementById("code").value;
document.getElementById("editor").style.display = "inline";
document.getElementById("code").style.display = "none";
}
function CodeMode()
{
document.getElementById("code").value = editor.contentWindow.document.body.innerHTML;
document.getElementById("editor").style.display = "none";
document.getElementById("code").style.display = "inline";
}
</script>
</head>
<body onload="init();">
<select onchange="txtCommand("FontSize", this.options[this.selectedIndex].value);">
<option value="1">10</option>
<option value="2">12</option>
<option value="3">14</option>
<option value="4">18</option>
<option value="5">24</option>
<option value="6">32</option>
<option value="7">48</option>
</select>
<button onclick="txtCommand("Bold", "");"><b>B</b></button>
<button onclick="txtCommand("Italic", "");"><i>I</i></button>
<button onclick="txtCommand("Underline", "");"><u>U</u></button><br />
<iframe name="editor" id="editor"></iframe>
<textarea id="code"></textarea>
<br />
<input type="button" value="Kildekode" onclick="CodeMode();" />
<input type="button" value="Design" onclick="NormalMode();" />
</body>
</html>
Og her er et link til siden med problemet
http://itgeeks.wep.dk/567test567/admin/Editor.htmlHvad gør jeg forkert?