Electric Type

Multimedia

About Us

News

Help

How to Steal JavaScript
by Nadav Savio 20 Jul 1999

Nadav Savio runs Giant Ant Design, a human-centered interactive design shop. When he's not cursing non-standard browser implementations, you can find him drawing futuristic utopias or updating his interface-design weblog, antenna.

Page 1

As Stewart Brand famously said, "Information wants to be free." And while generic human greed generally stands in the way of gratis info, JavaScript is a happy exception. The JavaScript code you covet on other people's pages is, in most cases, yours for the taking.

The trouble is, you can't just grab someone else's code, drop it into your Web page, and have it work. You actually have to learn JavaScript, even just the basics. Otherwise you may have trouble making that neat rollover or form checker function the way it should on your own page.

That's where this article comes in. I'll give you just enough JavaScript know-how (and not one bit more) to effectively steal code and still adhere to the first great virtue of the programmer: laziness. By the time you finish with this lesson, you should be able to take someone else's code and use it for your own unique purposes.

But lest I get spammed with hate mail, let me make it perfectly clear that "stealing" code is only OK if it's not really stealing. There's lots of JavaScript out there that was meant to be shared, and most people will be happy for you to use their code as long as you give them credit and you use it with your own content (i.e., grabbing code to make your own buttons into rollovers is good; stealing someone else's code and buttons and layout is bad). Finally, if you're not sure it's kosher to use a particular bit of JavaScript, then you need to ask the original author first.

Aside from making sure your code is moral, you also need to know how to cut and paste text and view source code. You got all that? OK then, let's dig in, starting with script tags.

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.