请问如何在javascript里面设置一个能保存最后一次改变结果的变量,能在下次调用javascript时候继续使用 请问如何在javascript里面设置一个能保存最后一次改变结果的变量,能在下次调用javascript时候继续使用 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 persistence?没有!写入文本可以:<div id="savetext">一些重要的东西</div><script language="javascript">obj = document.getElementById('savetext');fso = new ActiveXObject("Scripting.FileSystemObject");f1 = fso.CreateTextFile("c:\\file.txt", true); f1.Write(obj.innerHTML);f1.Close();</script>or<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>这里是一些要导出的信息</title></head><body><div id="savetext">这里是一些要导出的信息!</div><button onclick="exportFunc()">export</button><script>function exportFunc(){ var o=document.getElementById("savetext"); var win=window.open(""); win.document.open(); win.document.charset="gb2312"; win.document.write(o.innerText); win.document.execCommand("saveas",true,"a.txt"); win.opener=null; win.close();}</script></body></html> 保存到cookies吧。用再从cookies取 去掉重复的关键字 如何用JS实现地图拖动 急!如何实现可收缩的侧边栏 oo和event的问题,obj.func(event){}中如何引用对象本生? 如何消除链接文本的下划线 js和asp变量的交换问题 请教:在Javascript里面怎么关闭所有的图层 固定表头的设置? JS在IE下能够正常运行,在火狐下没有任何反应 js语法问题,大神请进 youtube js正则表达式
没有!
写入文本可以:
<div id="savetext">一些重要的东西</div>
<script language="javascript">
obj = document.getElementById('savetext');
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.CreateTextFile("c:\\file.txt", true);
f1.Write(obj.innerHTML);
f1.Close();
</script>
or
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>这里是一些要导出的信息</title>
</head><body>
<div id="savetext">这里是一些要导出的信息!</div>
<button onclick="exportFunc()">export</button>
<script>
function exportFunc()
{
var o=document.getElementById("savetext");
var win=window.open("");
win.document.open();
win.document.charset="gb2312";
win.document.write(o.innerText);
win.document.execCommand("saveas",true,"a.txt");
win.opener=null;
win.close();
}</script>
</body></html>