[Javascript] Newbie dipping toes in water

BEKIM BACAJ trojani2000 at hotmail.com
Sun Mar 2 14:45:13 CST 2003


Hello there,
here is some script I wrote, can help you getting ideas:
<script>
function getHREF(){

var	itsAncor=window.event.srcElement

	if ( itsAncor.tagName == "A" ) {//making sure the command is triggered only 
wen ancor encountered
		alert(itsAncor)//display the ancor navigational address
return(false)//dissabling the contextMenu over ancorTags
				}
		}
document.oncontextmenu=getHREF//invoking the command
</script>

Any further questions, -no hasitations, the same forum!

Cheers!



>From: Peter Vogel <pvogel at righthemisphere.com.au>
>Reply-To: javascript at LaTech.edu
>To: javascript at LaTech.edu
>Subject: [Javascript] Newbie dipping toes in water
>Date: Sun, 02 Mar 2003 17:54:00 +1100
>
>I want to write a JavaScript that does something like the "copy shortcut"
>command in the right-click menu in IE6.  That is, I want tto read the
>value of the link that was right-clicked before selecting my script from
>the right-click menu.
>
>I have managed to do the registry entires to add the item to the menu,
>and it executes a file of my choice, however now I need to know where to
>find the definitions I will need to use to get the link data from the
>displayed html document into my script.
>
>I have found examples that use things like
>
>var win = external.menuArguments;
>document.all.location.value = win.location.href;
>document.all.location.select();
>
>but can't find where this is all defined/explained.
>
>Thanks for any advice on this.
>
>Peter
>
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail




More information about the Javascript mailing list