1 | <html> |
---|
2 | <head> |
---|
3 | <title>bug with getSelection null</title> |
---|
4 | <script type="text/javascript" src="fckeditor/fckeditor.js" ></script> |
---|
5 | </head> |
---|
6 | <body> |
---|
7 | <input type="button" value="Generate a visible editor by code (OK)" onclick="AddEditor(true);" /> |
---|
8 | <input type="button" value="Generate a hidden editor by code (KO)" onclick="AddEditor(false);" /> |
---|
9 | <script type="text/javascript"> |
---|
10 | var counter = 0; |
---|
11 | function AddEditor(visible) |
---|
12 | { |
---|
13 | var container = document.body.appendChild(document.createElement("div")); |
---|
14 | if (!visible) |
---|
15 | { |
---|
16 | container.style.display = "none"; |
---|
17 | } |
---|
18 | var textarea = container.appendChild(document.createElement("textarea")); |
---|
19 | textarea.id = "editor" + counter++; |
---|
20 | var fckEditor = new FCKeditor( textarea.id ) ; |
---|
21 | fckEditor.ReplaceTextarea() ; |
---|
22 | } |
---|
23 | </script> |
---|
24 | </body> |
---|
25 | </html> |
---|