Solved

Disabling Ctrl-N

Posted on 2004-04-24
2
379 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now