Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

Disable Print screen

Javascript coding ..

Moderators: macek, egami, gesf

Disable Print screen

Postby php-vikas » Wed Dec 08, 2004 10:30 am

Hello,

Can anyone tell me the way or script that i can disable a print screen button on a keyboard.

Thanks.

Vikas Garg
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby swirlee » Wed Dec 08, 2004 1:53 pm

No, there is no way to do this, and trying to limit users' ability to use their own computers is always a bad idea.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby ruturajv » Wed Dec 08, 2004 7:45 pm

I don't know if this is possible to the keypress event for that button may be set... overridden...
But I have no Idea if that button has any ascii value, I doubt..
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby php-vikas » Thu Dec 09, 2004 1:26 am

Even i was also thinking so that it is bad idea to stop the visitor from using his own machine. However still i want to know that how can i restrict the user from printing my page.


Thanks.

Vikas Garg
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby Alexej Kubarev » Thu Dec 09, 2004 2:28 am

Ehh... i wrote a site protections script and added this function in case someone wants to use diasable print screen :

if(document.all) window.onbeforeprint=new Function("window.location='';");

That works perfect on all browsers...
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby swirlee » Thu Dec 09, 2004 11:12 am

Alexei Kubarev wrote:That works perfect on all browsers...


Um, except browsers with JavaScript turned off.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Alexej Kubarev » Thu Dec 09, 2004 1:10 pm

well..jahh... i ment all of those that spport JS... ;)
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby swirlee » Thu Dec 09, 2004 1:47 pm

Alexei Kubarev wrote:well..jahh... i ment all of those that spport JS... ;)


Most (all?) browsers that support JavaScript still allow you to turn it off, which I find myself doing frequently (especially when misguided webmasters try to prevent me from using the functions of my own computer).
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Alexej Kubarev » Thu Dec 09, 2004 2:01 pm

well... i never said that it was a good idea to disable printscreen... but still if someone wants.. i made it possible in my script... damn,... im a bit drunk now... celebrating my birthday :D
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby php-vikas » Thu Dec 09, 2004 10:28 pm

Thanks Alexei .

I think it would work for me. enjoy your birthday.


Many Many happy returns of the days.


Vikas Garg
http://www.phpdir.com
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 4 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron