aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes disabling right click using jquery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "disabling right click using jquery" Watch "disabling right click using jquery" New topic
Author

disabling right click using jquery

mahesh shinde
Ranch Hand

Joined: Jul 24, 2009
Posts: 69




This page forms the frame base of my application. I would like to disable right clicks throughout my application. I am trying to do thisd using jquery but its not working. It seems the body tag is required but when I put the body tag, the page displayed is blank.

The jquery code is :-
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Please make a note of InterfaceDesignersRule1, which states that you shouldn't be doing it. What is the reason for wanting to do something that is sure to annoy some users?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Most browsers have a checkbox in their settings that make it impossible to disable the context menu.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You use include tags for the JavaScript Code? That is not a good idea at all.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Eric Pascarello wrote:You use include tags for the JavaScript Code? That is not a good idea at all.

Seriously!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
mahesh shinde
Ranch Hand

Joined: Jul 24, 2009
Posts: 69

thanks for replies
i will correct my code instead of include i will use script tag
But when that script executed it will give error like "object not found"
Because of frameset it will give such error?
thanks again for replies
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
The error message should mention which object is not found.
mahesh shinde
Ranch Hand

Joined: Jul 24, 2009
Posts: 69

the object is "window.frames[i].document"
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
i !== k

Eric
mahesh shinde
Ranch Hand

Joined: Jul 24, 2009
Posts: 69

yes i replace i with k after post sorry for that
but still object not found error
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Are you calling it before the page is fully loaded?

If you are using jQuery, you should use http://docs.jquery.com/Tutorials:Introducing_$(document).ready()

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: disabling right click using jquery