473,394 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

disable context menu bar in browser

I want to disable context menu bar in browser, and I do the following
by copying a code in net, it is working though, but I just don't
understand what is new Function here means, can anyone advise?
thanks!!

document.onselectstart=new Function ("return false");
Jul 23 '05 #1
1 3775
In article <ba**************************@posting.google.com >,
jr********@hotmail.com enlightened us with...
I want to disable context menu bar in browser, and I do the following
by copying a code in net, it is working though, but I just don't
understand what is new Function here means, can anyone advise?
thanks!!

document.onselectstart=new Function ("return false");

It just reassigns the event a new handler that does nothing at all, basically
cancelling the event. I don't think it's cross-browser.

Disclaimer / my 2 cents: In the vast majority of cases, doing what you're
doing is at best a Bad Idea and at worst illegal (UK internet accessibility
law). Most people reassign the context menu to try to keep people from
stealing things. That's so ineffective, it's laughable, and it irritates
legit users. The only reason you should be re-assigning the context menu is
to provide a better one for an intranet application. Since I don't know what
you're doing, this comment should be taken in general, not specific to you,
so don't get your panties in a wad. ;)

HTH

--
--
~kaeli~
If a book about failures doesn't sell, is it a success?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: yaktipper | last post by:
This explains how to disable the view source / right-click menu in Netscape 4, Netscape 6 and Internet Explorer (IE). <script language="JavaScript"> //This code is the beginning of the right...
4
by: Lijun Yang | last post by:
Hey, I am able to disable the right mouse button on images for netscape and IE but it won't work for Opera. Here is the code: // start of the code var clickmessage="Sorry, you don't have...
2
by: ourspt | last post by:
Hi, We are working on a .NET application (ASP.NET/VB.NET). We need to suppress (disable) the 'Back' button in the menu of the browser. What is the way to do that? Thanks in advance oursmp
6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
29
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank...
8
by: Ken Yu | last post by:
Hi, How can i disable "RightClick Menu" in Internet Explorer, when access the frontpage ? tks a lot ! Ken
16
by: Alex Clark | last post by:
Hi All, I'm sure this must have been asked a million times due to it's usefulness, but are there any sensible solutions for disabling right click (and other services such as Ctrl+P, Browser...
8
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? -----------------------------------------------------------------------...
5
by: neehakale | last post by:
language using: C#. platform for program: WINDOWS FORM I wnt to disable the right click for text boxes.And also want to diable the context menu. I have already disable the Minimize and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.