• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

disabling right click using jquery

 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most browsers have a checkbox in their settings that make it impossible to disable the context menu.

Eric
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You use include tags for the JavaScript Code? That is not a good idea at all.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:You use include tags for the JavaScript Code? That is not a good idea at all.

Seriously!
 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message should mention which object is not found.
 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the object is "window.frames[i].document"
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i !== k

Eric
 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i replace i with k after post sorry for that
but still object not found error
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic