右键菜单[写入注册表]读取所选文字图片并将地址发送到指定页面!
日期:2005-8-8 19:21:12 人气: 34 [大字体 中字体 小字体]
注册表文件
REGEDIT4
[-HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\+ Offline &Explorer: Download the link]
[-HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\+ Offline E&xplorer: Download the current page]
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt]
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\asthlon-推荐给朋友]
@="http://localhost/songcak/songcak/MouseAdd/index.aspx"
index.aspx 文件
<script LANGUAGE="Javascript">
//asthlon
function getfullpath(url)
{
var iIndex=url.lastIndexOf('/');
if(iIndex!=-1)
{
return url.substring(0,iIndex+1);
}
else
return url;
}
if (external.menuArguments) {
var parentwin = external.menuArguments;
var tp = '&tp=txt';
if (parentwin.document.selection) {
var sel = parentwin.document.selection.createRange().text;
}
if (!sel) {
var sel = '';
}
var url = parentwin.location.href;
var title = parentwin.document.title;
if (parentwin.event.srcElement.tagName == "A") {
url = parentwin.event.srcElement.getAttribute("HREF");
title = parentwin.event.srcElement.innerText;
}
else if(parentwin.event.srcElement.tagName == "IMG")
{
url = parentwin.event.srcElement.getAttribute("SRC");
tp = '&tp=pic';
}
void(window.open(getfullpath(document.location.href)+'../Add.aspx?t='+escape(title)+'&u='+escape(url)+'&c='+escape(sel) + tp,'PostTie'))
} else {
//history.go(-1);
}
//window.open('add.aspx','PostTie','')
window.open(getfullpath(document.location.href)+'Add.aspx?t='+escape(title)+'&u='+escape(url)+'&c='+escape(sel) + tp,'PostTie','')
</script>
> >更多精彩技术文章>http://www.66of.com