Demo code:
The above code can only be used in It is used under the IE kernel browser, but for the specific above code saving function, you can refer to the following code.
function runCode(obj) {
var winname = window.open('', "_blank", '');
winname.document.open('text/html', 'replace');
winname.opener = null // Prevent code from entering the parent page Modify
winname.document.write(obj.value);
winname.document.close();
}
function saveCode(obj) {
var winname = window.open(' ', '_blank', 'top=10000');
winname.document.open('text/html', 'replace');
winname.document.write(obj.value);
winname.document.execCommand('saveas','','code.htm');
winname.close();
}
function oCopy(obj){
obj. select();
js=obj.createTextRange();
js.execCommand("Copy");
alert("Script Home Tip: The code has been successfully copied!");
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn