This is a really great little beauty from JarC!
It's a little javascript to be used as onmousedown eventhandler, it works in IE5
and IE6, the code is prepared for use in Netscape, but can't test it as I don't
have it installed...Opera...well what can I say...maybe someday...but if it is
not too different than this will probably work in Opera too...
Installation is real simple, just let the script be tagged to the end of the
page or include it in 'end.js' if you use that one. Just incase, the required
filter to add it is included in the zipfile, ready to merge...
If you use End.js to null all those events, make /absolutely sure/ the required
onmousedown event is /not/ nulled, otherwise this replacement handler won't get
called...
It is meant as a little aid in knowing
what the html looks like when trying to find out where in htmlcode that ad is
created...just Ctrl-Rightclick the area and an alertbox will pop up showing the
html for the complete enclosing tag...
From JarC
[Patterns]
Name = "<end> Tag Reporter"
Active = TRUE
Limit = 1
Match = "<end>"
Replace = "<script Language="JavaScript" src="dhtml/ReportTag.js">"
"</script>"
----------------8<----------------------------------------------
Her is the js file
ReportTag.js// Tag Reporter
// Author: Raj Gabri?lse
// Written: 1/11/2001
//
// This is a little javascript to be used as onmousedown eventhandler,
// it works in IE5 and IE6, the code is prepared for use in Netscape,
// but I can't test it as I don't have it installed...
// Opera...well what can I say...maybe someday...but if it is not too
// different than this will probably work in Opera too...
//
// Installation is real simple, just let the script be tagged to the
// end of the page or include it in 'end.js' if you use that one.
// Just incase, the required filter to add it is included in the zipfile,
// ready to merge...
//
// If you use End.js to null all those events, make /absolutely sure/
// the required onmousedown event is /not/ nulled, otherwise this
// replacement handler won't get called...
// =============================================================================
function Document_OnMouseDown(evt) {
//
// ok, you get the drift, comment/uncomment as appropriate
//
// if (top.isIE) <-- this line can stay a comment unless you use both browsers
var myEvent = event;
// if (top.isNN4) <-- this line can stay a comment unless you use both browsers
// var myEvent = evt;
if (myEvent.button == 2||myEvent.which==3) {
var ctrlKey = document.layers ? myEvent.modifiers & Event.CONTROL_MASK : myEvent.ctrlKey;
// var altKey = document.layers ? myEvent.modifiers & Event.ALT_MASK : myEvent.altKey;
// var shiftKey = document.layers ? myEvent.modifiers & Event.SHIFT_MASK : myEvent.shiftKey;
if((ctrlKey) & (myEvent.srcElement.nodeName != 'BODY')) {
// if((altKey) & (myEvent.srcElement.nodeName != 'BODY')) {
// if((shiftKey) & (myEvent.srcElement.nodeName != 'BODY')) {
myEvent.cancelBubble = true;
alert(myEvent.srcElement.outerHTML);
return true;
}
}
}
// IMPORTANT !!! DO NOT NULL THIS EVENT !!!
if(document.layers) document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = Document_OnMouseDown;
----------------------8<---------------------------------
Best wishes
Arne

Imici username: Arne
