右鍵菜單[寫入註冊表]讀取所選文字圖片並將地址發送到指定頁面!

註冊表文件

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>

add.aspx 文件爲接收請求處理文件

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章