thanks for reply
it cannot solve the errors because it needs to run "editor.ExecCommand('new')" before to clear the editor content
because need to use following functions to get the selected file path
- function editor_function() {
- var editor = document.getElementById('<%=editor.ClientID%>');
- editor.FocusDocument();
- editor.ExecCommand('new');
-
- InputURL();
-
- editor.ExecCommand('InsertDocument');
- }
-
- function InputURL() {
- var editor = document.getElementById('<%=editor.ClientID%>');
- var editdoc = editor.GetDocument();
- var links = editdoc.getElementsByTagName("a");
-
- var link_data = "";
- for (var i = links.length - 1; i >= 0; i--) {
- if (links[i].href != "") {
- link_data = links[i].href;
- break;
- }
- }
-
- if (link_data != "") {
- document.getElementById('file_path_textfield').value = link_data;
- }
- else {
- setTimeout(InputURL, 500);
- }
- }