Solved

Disabling Ctrl-N

Posted on 2004-04-24
2
383 Views
Last Modified: 2012-05-04
Is there a way to prevent a user from spawning a new window. I want to hide the URL and (it is - until someone does a Ctrl-N).   This is just one approach I'm looking at -- it would be the easiest if it works, the others require more coding and changes but are better long term.  I was just looking for a solution to get my by for a while with a client.

Thanks.
0
Comment
Question by:Bl248
2 Comments
 
LVL 18

Accepted Solution

by:
Plucka earned 125 total points
ID: 10910590
Hi Bl248,

Yes there is.

Here is a working example.

<script language="javascript">
      function keyPress() {
            if (event.ctrlKey && event.keyCode == 78) {
                  event.keyCode = 0;
                  event.returnValue = false;
                  return false;
            }
      }
</script>

<body onkeydown="keyPress();">

Regards
Plucka
0
 

Author Comment

by:Bl248
ID: 10911544
Thanks very much .. I figured this had been asked and answered before but I was not able to find it after searching serverl different ways.

Thanks for your prompt reply.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to refer to value 8 62
Dynamic Dropdowns 15 32
How to add a stringified JSON string to an IP address? 11 56
on window close, not beforeunload 6 15
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question