脚本如下:
<SCRIPT LANGUAGE="JavaScript">
window.open('http://www.Test.cn/index.php?view=booklet&title='+encodeURIComponent(external.menuArguments.document.title)+'&url='+encodeURIComponent(external.menuArguments.location.href),'add','height=300,width=700');
</script>在浏览器的右键菜单里调用,打开一个窗口,可是弹出的是默认浏览器的窗口,我想弹出的是指定浏览器的窗口
怎么处理?
比如:我当前打开的是IE窗口,那么在IE的窗口中右键点击执行脚本,弹出的是世界之窗(我的默认浏览器为世界之窗)
我想弹出的也是当前的IE窗口
<SCRIPT LANGUAGE="JavaScript">
window.open('http://www.Test.cn/index.php?view=booklet&title='+encodeURIComponent(external.menuArguments.document.title)+'&url='+encodeURIComponent(external.menuArguments.location.href),'add','height=300,width=700');
</script>在浏览器的右键菜单里调用,打开一个窗口,可是弹出的是默认浏览器的窗口,我想弹出的是指定浏览器的窗口
怎么处理?
比如:我当前打开的是IE窗口,那么在IE的窗口中右键点击执行脚本,弹出的是世界之窗(我的默认浏览器为世界之窗)
我想弹出的也是当前的IE窗口
http://canfly2010.javaeye.com/blog/565798
你可以使用Shell脚本运行命令行比如iexplore.exe http://dotnet.aspx.cc
第二,右键菜单,在当前浏览器窗口,右键菜单弹出跟当前浏览器一样的窗口没有什么方法吗,不一定要用
open函数
因为你当前的浏览器窗口,右键菜单,然后弹出的是别的浏览器窗口,感觉真的很不友好
iexplore.exe http://dotnet.aspx.cc
我的js脚本功能有获取当前标题和url的,如果按你的这个方法如何实现这个脚本呢?
谢谢了
HINSTANCE hResult =ShellExecute(NULL,_T("open"),_T("iexplore.exe"),_T("http://www.qihuatong.com"),NULL,SW_MAXIMIZE);
if ((int)hResult<=32)
{
ShellExecute(NULL,_T("open"),_T("http://www.zzy.cn"),NULL,NULL,SW_SHOW);
}用ShellExecute ,把上面的iexplore.exe换成你要的浏览器程序.exe
external.menuArguments.window.open
不过,对于百度的搜索页,会提示:
external.menuArguments.location.href为空或不是对象,
这个又是怎么回事,好像只有百度的搜索页会这样