14個經典的Javascript代碼(常见的操作代码:另存、打开、刷新等)
■打開■
<input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打開>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■另存為■
<input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value =另存為><OBJECT classid=CLSID:8856F961-340A-11D0-A96B- 00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■屬性■
<input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type= button value=屬性><OBJECT classid=CLSID:8856F961-340A-11D0-A96B- 00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■打印■
<input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value =打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B- 00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■頁面設置■
<input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value =頁面設置><OBJECT classid=CLSID:8856F961-340A-11D0-A96B- 00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■刷新■
<input type=button value=刷新 name=refresh onclick="window.location.reload()">
■導入收藏■
<input type="button" name="Button" value="導入收藏夾" onClick=window.external.ImportExportFavorites(true,);>
■導出收藏■
<input type="button" name="Button3" value="導出收藏夾" onClick=window.external.ImportExportFavorites(false,);>
■加入收藏■
<INPUT name=Button2 onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夾>
■整理收藏夾■
<INPUT name=Submit2 onclick="window.external.ShowBrowserUI(OrganizeFavorites, null)" type=button value=整理收藏夾>
■查看原文件■
<INPUT name=Button onclick=window.location = "view-source:" + window.location.href type=button value=查看源文件>
■語言設置■
<INPUT name=Button onclick="window.external.ShowBrowserUI(LanguageDialog, null)" type=button value=語言設置>
■前進■
<INPUT name=Submit onclick=history.go(1) type=submit value=前進>
■後退■
<INPUT name=Submit2 onclick=history.go(-1) type=submit value=後退>
posted on 2011-06-23 11:40
super_nini 阅读(299)
评论(0) 编辑 收藏