我正在制作一个书签来打开一个页面的链接,但它还需要触发mousedown / mouseup事件......我制作了书签来点击并打开链接但不能让它来解雇鼠标事件:( ......
javascript:(function(){
function clickLink(link) {
if (document.createEvent) {
var event=document.createEvent("MouseEvents");
event.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
} else if (link.fireEvent) {
link.fireEvent("onclick");
}
}
l=document.links;
for(var i=0;i<l.length;++i) {
clickLink(l[i]);
};})();
请帮忙! ...提前致谢!