Posts Tagged ‘javascript’


why disabling right click is pointless

May 8, 2008

A few people out there think that if they add some simple JavaScript to disable right clicking, their code will be safe. For those of you wondering, yes, this can be done. And yes, it is totally pointless.

Here is a link to the script:

Web developers dream of the day when there (client-side) code would be completely invisible to visitors. Why, you might ask? Because, it takes time to develop sweet scripts to make a website functional; who wants some script kiddie stealing borrowing there precious scripts. Not only that, Mac users could care less about right clicking, they only have a single click!

Normally by right-clicking (in Windows) on a web page, you have access to such great features like: properties, view page info, exporting options (depending on your browser), and the infamous view page source. The thing is, you could also view a page’s source (and other exciting options) by clicking on your browsers tool bar and finding the same option. And if you think that you might be protecting your images by disabling this function, just remember that there is a little thing called cache.

With this in mind, why would someone want to disable right clicking? Is there any functional reason that someone would do so? Please, someone tell my why you would want to do this, I just don’t get it.


my new obsession; jQuery

October 11, 2007

So it’s been around for awhile (Jan. 06 to be exact). I LOVE IT. It’s basically the love child of AJAX and JavaScript. You can do so many cool things with it. I’m still getting to know the language, but from what I’ve seen so far I’m very impressed.

The Internet is ever expanding and everyday developers are coming out with technology that smacks you in the face and doesn’t bother apologizing. Here I thought that animating on the web was (Adobe’s) Flash domain. Nope. With jQuery, animation is (somewhat) simple. You can’t necessarily do everything that Flash can do, but it does allow for less processing on the client side. You don’t even need a plug-in to run the scripts. This is wonderful. See for yourself:


view source

July 9, 2007

view source
If you don’t know by now, all client-side scripts are available by viewing the source code with your browser.
Internet Explorer: Right-click > View Source
Firefox: Right-click > View Page Source

What’s so special about looking at a pages source? Well, the most obvious is that you can see what other developers did to get their page how they did. It’s impossible to server-side code (ASP, JSP, PHP) simply because it’s processed on the server (hence the clever name). That being said, you can still see some juicy code with your browser using the methods above.

If you like a particular color or effect that is used on a web page, do some snooping and you just might find the source you need. Sometimes developers put their JavaScript and CSS files in outside folders as opposed to putting them directly on the page. This keeps the code cleaner and easier to maintain. Check out the source of any webpage and start investigating! You might see a link to a CSS style sheet somewhere at the top of the code (usually the first 10-20 lines). The formatting for that is:

<link rel “stylesheet” href=”../blah.css” type=”text/css”>

The “../” means one level up in the directory structure. Now all you have to do is find out what directory your in on the website, go a level up and type the name of the CSS style sheet. You can also do the same thing for JavaScript. Often times the full URL for the script is in the href for the include. If your lucky, the developer may have included comments that explain what is going on.

Go on now, view source!!