Solved

Disabling Ctrl-N

Posted on 2004-04-24
2
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…

756 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