hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : How to detect right click location with Javascript?
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

How to detect right click location with Javascript?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-16-2009, 04:51 PM
Lord Northern Lord Northern is offline
Junior Guru
 
Join Date: Feb 2006
Location: Israel
Posts: 187

How to detect right click location with Javascript?


Hi.
I have a little gallery that shows up little thumbnails and some people copy these thumbnails without going to the actual photo but by simply right clicking on the photo, and saving it.

So, I was wondering if I can track it down? Like, for a left mouse click I could do onmouseclick with the photo ID and run an ajax script to report a click
So, is there an equivalent to this trigger that would only be triggered when there's a right click on a certain photo?
Using the right click menu is not a solution because it is triggered regardless of location or what item it was clicked on, so I was wondering if there was a way for me to track it down?

Thanks.

__________________
Defend Net Neutrality.

Reply With Quote


Sponsored Links
  #2  
Old 08-16-2009, 06:16 PM
justin3ds justin3ds is offline
Junior Guru Wannabe
 
Join Date: Aug 2009
Location: CA, USA
Posts: 34
Talking

well tracking down the "copy" option from the drop down menu is impossible, but you can disable right clicking (but they can always use view -> source), or track it, although it will be inaccurate. for an example, i right click on images all the time to open them up in tabs (although you could have a script on the page it goes to to register if they did or did not open it up in a tab, although that gets complicated)

but yes, you could have a trigger only for a certain photo, just register the onmouseclick with the thumbnail, not the document. here are some helpful links:
Registering the Right Click
Ajax Solution
Ajax Solution

Reply With Quote
  #3  
Old 08-16-2009, 06:56 PM
larwilliams larwilliams is offline
Premium Member
 
Join Date: Jan 2008
Location: St. John's, NL
Posts: 2,027
All you would be doing is annoying people who may wish to view the image in a new window. Anyone who wants to copy the image would not be stopped by such a simplistic measure.

__________________
Cpanel/WHM • PHP • Perl • Ruby • Full Time Support
LCWSoft - Canadian web hosting since 2007
Servers based in the US and Canada (Uptime Report)

Reply With Quote
Sponsored Links
  #4  
Old 08-16-2009, 07:24 PM
Lord Northern Lord Northern is offline
Junior Guru
 
Join Date: Feb 2006
Location: Israel
Posts: 187
I'm not trying to stop them. I just want to know where they right clicked

__________________
Defend Net Neutrality.

Reply With Quote
  #5  
Old 08-16-2009, 10:03 PM
foobic foobic is offline
Community Liaison 2.0
 
Join Date: Feb 2005
Location: Australia
Posts: 5,110
Have you tried using onclick? (where does "onmouseclick" come from anyway?)

__________________
Chris

"Learn from the mistakes of others. You can never live long enough to make them all yourself." - Groucho Marx

Reply With Quote
  #6  
Old 08-17-2009, 03:20 AM
Lord Northern Lord Northern is offline
Junior Guru
 
Join Date: Feb 2006
Location: Israel
Posts: 187
well, is there an onmouse something click to detect right clicks?

__________________
Defend Net Neutrality.

Reply With Quote
  #7  
Old 08-17-2009, 03:23 AM
foobic foobic is offline
Community Liaison 2.0
 
Join Date: Feb 2005
Location: Australia
Posts: 5,110
onclick is the event handler. It fires on both left and right clicks.

__________________
Chris

"Learn from the mistakes of others. You can never live long enough to make them all yourself." - Groucho Marx

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript: how to detect element type? grabmail Programming Discussion 2 03-21-2006 08:59 AM
Detect If Javascript is Disabled? war59312 Web Design and Content 20 09-23-2005 07:21 AM
click-once javascript code imagerage Web Design and Content 2 07-16-2005 02:07 AM
javascript form field - clear when you click aqi32 Web Design and Content 1 02-17-2004 05:31 PM
Right-Click Javascript - Open New Window gamemaster Hosting Security and Technology 5 01-30-2004 01:47 PM

Related posts from TheWhir.com
Title Type Date Posted
Facebook Engineer Develops Heat Map Software to Detect Problem Servers in Data Center Web Hosting News 2012-09-21 12:48:38
Software Developer Softaculous Launches Softaculous Auto Installer Version 3.8 Web Hosting News 2011-11-25 15:34:49
Noise Filter: Role of ISPs Questioned After DNSChanger Arrests Web Hosting News 2011-11-18 16:11:29
Attracta Offers Single-Click Web App Installation to Customers Web Hosting News 2011-08-11 16:57:09
Trustwave Adds More PCI DSS Compliance Services to Security Platform Web Hosting News 2011-06-01 14:23:57


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?