[Javascript] Newbie dipping toes in water
Peter Vogel
pvogel at righthemisphere.com.au
Sun Mar 2 22:10:15 CST 2003
Thanks for the example. Unfiortunately I couldn't get it to work, and
there were aspects I didn't understand, so I thought I should try
cutting it down to this:
<HTML>
<SCRIPT LANGUAGE="JavaScript">
var itsAncor=window.event.srcElement
if ( itsAncor.tagName == "A" ); { alert(itsAncor)}
</SCRIPT>
</HTML>
Now i get an error saying "Object required" in line 3.
Could you tell me where I can find details/explanations of the objects
e.g.
window.event.srcElement
Where is there a goiod general Javascript reference site?
Thanks
Peter
On Sun, 02 Mar 2003 21:45:13 +0100
"BEKIM BACAJ" <trojani2000 at hotmail.com> wrote:
> 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
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
More information about the Javascript
mailing list