Solved

Disabling Ctrl-N

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

772 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