window.external的使用

简介:window.external.AddFavorite这个把网站添加到浏览者收藏夹的脚本大家应该常常看过,但你还知道window.external的另外一些用法呢?由于是一些关于系统文件操作的命令,因为安全设置有些脚本会出错误.
1.external.AddDesktopComponent 把网站作为用户的Active桌面 
<script language="JavaScript" type="text/javascript"> function j_adc(){ window.external.AddDesktopComponent("http://www.ie-zone.com","website",0,0,800,600); } </script>
语法:external.AddDesktopComponent(地址,类型[image/website],左距离,顶距离,宽度,长度)
function j_adc(){ //例子
window.external.AddDesktopComponent("http://www.ie-zone.com","website",0,0,800,600);
}

2.external.AddFavorite 把网站加入到用户的收藏夹 
<script language="JavaScript" type="text/javascript"> function j_af(){ window.external.AddFavorite(location.href, document.title); } </script>
语法:external.AddFavorite(网址,标题);
function j_af(){
window.external.AddFavorite(location.href, document.title);
}

3.external.NavigateAndFind 搜索指定网站中的某个字段  
<script language="JavaScript" type="text/javascript"> function j_an(){ window.external.NavigateAndFind("http://www.ie-zone.com/js/ref01101432.htm",gosearch.value,""); } </script>
语法:external.NavigateAndFind(文件地址,关键字,_Target)
<script language="JavaScript">
function j_an(){
window.external.NavigateAndFind("http://www.ie-zone.com/js/ref01101432.htm",gosearch.value,"");
}
</script>

4.external.ShowBrowserUI 调用语言选择窗口与收藏夹管理窗口  
<script language="JavaScript" type="text/javascript"> function j_an(){ window.external.NavigateAndFind("http://www.ie-zone.com/js/ref01101432.htm",gosearch.value,""); } </script>
语法:external.ShowBrowserUI(类型[LanguageDialog/OrganizeFavorites], null)
<input type="button" name="Button" value="语言设置" οnclick="window.external.ShowBrowserUI('LanguageDialog', null)">
<input type="button" name="Submit2" value="整理收藏夹" οnclick="window.external.ShowBrowserUI('OrganizeFavorites', null)">

5.external.ImportExportFavorites 导入与导出用户收藏夹  
<script language="JavaScript" type="text/javascript"> function j_an(){ window.external.NavigateAndFind("http://www.ie-zone.com/js/ref01101432.htm",gosearch.value,""); } </script>
语法:external.ImportExportFavorites(导入/true 导出/false, 文件路径)
<input type="button" name="Button" value="导入收藏夹" onClick=window.external.ImportExportFavorites(true,"http://www.ie-zone.com/ibook2.php");>
<input type="button" name="Button3" value="导出收藏夹" onClick=window.external.ImportExportFavorites(false,"http://www.ie-zone.com/ibook.php");>
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值