View Full Version : What you CANNOT do with JavaScript

06-22-2007, 10:12 AM
This thread is quite old now and has been unstickied as some of the advice is no longer accurate.

Please don't post questions in this thread.

What you cannot do with JavaScript

1. You cannot disable certain features of the browser (eg. Print, Copy etc.)
2. Disable right-click effectively
3. Stop people from accessing your page with JavaScript alone
4. Make people not steal your work.
5. Protect your images.
6. Manipulate the browser
7. Hide menus
8. Disable certain options of the browser

Don't bother asking about this, we might not answer it.

If anyone wants to add anything else here, feel free to do so.

06-22-2007, 04:18 PM
Also; you can't read, write, or delete files off the server nor the client's computer. Something else that Javascript can't do is interact with the server (unless you utilize AJAX or similar).

07-02-2007, 03:06 PM
Another thing you can't do is refresh an iframe on a different domain.

07-02-2007, 07:19 PM
You can't send emails with javascript

07-02-2007, 07:48 PM
And, better yet, there are some things you can do with JavaScript that you probably shouldn't.

08-17-2007, 01:28 PM
To the end of 3. Stop people from accessing your page with JavaScript alone
add Use .htaccess or CGI instead
that'll stop them from asking what to use instead :)

08-26-2007, 09:37 AM
Javascript cannot access the local file system. You cant read or write files on the user’s computer - its a security feature to prevent sites doing anything they like on your computer (like leave a virus…)
Javascript cannot access the remote file system either! It used to be the accepted knowledge that you couldn't even access files hosted on the server…things have changed slightly with the wide-spread support for XMLHttpRequest, but you've still only got HTTP to play with - you cant move files around, rename them, change permissions or anything like that on the server using only Javascript.
Javascript cannot run any application outside the browser. Just like with point 1, this is a security feature to prevent a website doing as it pleases.
Javascript cannot access your printer/scanner/webcam. Javascript has no direct access to your peripherals without relying on 3rd party tools etc.
Javascript cannot change the URL displayed by the browser. Again this is for security reasons, otherwise any old site could simply change the displayed URL to look like your Bank’s or PayPal’s etc secure site to trick you into entering your details.
Javascript cannot change the browser history. For example, you cannot control which page appears if the user clicked on the “back” button in their browser.
Javascript cannot access your database. If you've got a MySQL or SQL Server database on your server, you cannot use Javascript to access it directly - you'll need to use a server-side language (e.g. PHP, ASP etc) for that.
Javascript cannot “encrypt” your HTML or prevent "image theft". It is pathetically easy to circumvent so-called Javascript “security” features, so its not even worth trying. If a user can see your page, they can steal it!
Javascript cannot control the user’s mouse or keyboard. Sorry but Javascript wont let you "hijack" a user’s mouse and move it to click on your site’s adverts to make you money!
Javascript cannot use multiple threads. There are some moves afoot to try and create some sort of library to accomplish this, but for now the advice is don’t worry about optimizing your Javascript for multiple core CPUs!

08-27-2007, 06:04 PM
JavaScript cannot:
Send emails
Add toolbars
Install Firefox
protect content
bounce hackers

09-01-2007, 02:38 AM
I already said protect content and djr33 already said about sending e-mails...

09-01-2007, 05:20 AM
What you cannot do with javascript:

Anything permanent
Anything that is mission critical
Anything secure

Please accept my apologies if I have duplicated any previous entries in this thread.