JavaScript另存代码的问题 <button onclick="document.execCommand('Saveas',false,'')">另存代码</button> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><style type="text/css"><!-- textarea{ width:500px; height:150px; border:1px solid #000; border-right:1px solid #C2C2C2; border-bottom:1px solid #c2c2c2; } --></style><script language="javascript"><!-- function save(){ var tcode=document.getElementById('code').value; hiddenFrame.document.write(tcode); hiddenFrame.document.execCommand('SaveAs','false','code.html'); } --></script></head><body> <textarea id="code"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html> <head> <title>HTML Template</title> <style text="text/css"> <!-- #layout{ margin:0px auto; background-color:#ccc; border:2px solid #333; width:300px; height:300px; } --> </style> </head> <body> <div id="layout">1列固定宽度</div> </body></html> </textarea> <br> <button onclick="save()">另存代码</button> <IFRAME NAME="hiddenFrame" SRC="a.html" WIDTH="0" HEIGHT="0"></IFRAME></body></html>a.html为任何一个页面/ 关于编辑器的缩进问题 extjs 怎么实现在一个页面点击另一个页面的按钮,在线等 PHP 如何获得JS值? 修改 jquery.pager.js 插件... 各位,麻烦帮我看下,这个js函数什么意思,谢谢! 关于table的显示问题 我是新手问个简单的问题 如何实现JS中fullscreen,但有工具栏? 网站防注入攻击,求指导。 js如何对一组数字进行分组操作 关于jQuery + JSON的一个奇怪的问题!!! 如何让script运行, 这个问题不太容易说明,看了代码会明白的,内详
<head>
<style type="text/css">
<!--
textarea{
width:500px;
height:150px;
border:1px solid #000;
border-right:1px solid #C2C2C2;
border-bottom:1px solid #c2c2c2;
}
-->
</style>
<script language="javascript">
<!--
function save(){
var tcode=document.getElementById('code').value;
hiddenFrame.document.write(tcode);
hiddenFrame.document.execCommand('SaveAs','false','code.html');
}
-->
</script>
</head>
<body>
<textarea id="code">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>HTML Template</title>
<style text="text/css">
<!--
#layout{
margin:0px auto;
background-color:#ccc;
border:2px solid #333;
width:300px;
height:300px;
}
-->
</style>
</head>
<body>
<div id="layout">1列固定宽度</div>
</body>
</html> </textarea>
<br>
<button onclick="save()">另存代码</button>
<IFRAME NAME="hiddenFrame" SRC="a.html" WIDTH="0" HEIGHT="0"></IFRAME>
</body>
</html>a.html为任何一个页面/