
页面有个按钮,点击后实现页面本地保存(即ctrl+s效果),请问各位高手firefox下怎么实现?谢谢
页面有个按钮,点击后实现页面本地保存(即ctrl+s效果),请问各位高手firefox下怎么实现?谢谢...
页面有个按钮,点击后实现页面本地保存(即ctrl+s效果),请问各位高手firefox下怎么实现?谢谢
展开
2个回答
展开全部
您好!很高兴为您答疑!
虽然可以用JS实现这个功能,保存页面指定内容的方法:
<script language=javascript>
function Save(){
var txt = document.all.output.value;
b = window.open();
b.document.open();
b.document.write(txt);
b.document.close();
b.document.execCommand('saveas',true,'output.html');
b.window.close();
}
</script>
<center>仅保存文本框中部分:</center>
<table width="90%" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>不保存</td>
<td><input type="button" value="Save" class="trans" onclick="Save()">
<textarea rows="20" cols="50" id="output" class="txtedit"></textarea>
</td>
</tr>
</table>
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
虽然可以用JS实现这个功能,保存页面指定内容的方法:
<script language=javascript>
function Save(){
var txt = document.all.output.value;
b = window.open();
b.document.open();
b.document.write(txt);
b.document.close();
b.document.execCommand('saveas',true,'output.html');
b.window.close();
}
</script>
<center>仅保存文本框中部分:</center>
<table width="90%" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>不保存</td>
<td><input type="button" value="Save" class="trans" onclick="Save()">
<textarea rows="20" cols="50" id="output" class="txtedit"></textarea>
</td>
</tr>
</table>
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询