About JavaScript:
What is JavaScript?
-
JavaScript is an object-based scripting language that's used to develop Internet applications.
Who created JavaScript?
-
Netscape, in an effort to further extend the functionality of its popular Navigator browser (ca. 1994), developed a programming language that can be placed within Web pages.
-
Originally called LiveScript, this new language was renamed JavaScript to capitalize on the popularity of the Java programming language developed by Sun Microsystems.
What is a 'scripting language'?
-
Computer applications can't be all things to all people, as hard as developers may try. To offset this, it's popular to allow the user to customize a program by writing little "program snippets" to do specialized things (such as spreadsheet macros).
-
For the most part, these "mini-programs" aren't compiled (like regular programs are), but are interpreted line by line while the application is running.
-
Programs such as these are called scripts, and the collection of commands and statements that can be used in a script is the scripting language.
-
JavaScript is a scripting language, it's syntax looking much like C (a programming language created by AT&T's Bell Labratories in 1972), C++ (Bell Labs' upgrade of C, ca. 1983), Pascal (a programming language used to teach programming, ca. 1970, named after French mathematician & philosopher Blaise Pascal), etc.
-
JavaScript commands and functions are put in your Web document with your other text and HTML tags.
-
When a user's browser retrieves your page, it "runs" your program and performs the appropriate operations.
-
NOTE: Because the browser runs a JavaScript program after a document is retrieved, the browser must be capable of interpreting the language. Currently, the five major browsers (Google Chrome, Mozilla Firefox, Apple Safari, Microsoft Internet Explorer, and Opera) have this capability.
Why do I have compatibility images at the bottom of this site?
-
I create my web pages using Notepad, the free text editor that comes with all versions of Microsoft's Windows operating systems (from the Start menu, click All Programs--Accessories), as well as SimpleText, the equivalent if I'm on my iBook. Normally, such files are saved with the extension .txt (text file in Notepad) or .rtf (rich text file on a Mac), but if you manually add the extension .htm or .html, then the icon to open it again for viewing is your default Internet/Web browser.
-
I have all five of the major browsers (hey, they are free: easy to find, easy to download!) on both my Mac and my HP (hence, the logo at the top of this screen).
-
I have owned and used different WebTVs, which were DVD-player sized units that could connect to any TV and using dial-up, to the Internet, even simultaneously using Picture-In-Picture. For a short while I was even a member of FutureNet (and owned quite a bit of its stock until it went from pennies to de-listing from the NASDAQ), a multi-level/network marketing company that sells WebTV and WebTV products & services. The company started in California in 1996 with former Apple & Atari programmers, and by 1998, Microsoft paid well over $400 million for it, as Bill Gates predicted such a product would exist in his 1995 book, The Road Ahead. I have to say, despite issues we all dealt using dial-up connections, WebTV was the best browser I have ever used! It supported so many more elements of HTML (tags and special attributes) that such programmers like myself could implement and create amazing web sites. But with the boom in subscribers using cable modems (and even fiber optics for businesses, military, and school organizations). WebTV was renamed MSN TV in the early 2000s and in September 2013 Microsoft officially ended service for them, due to low subscription numbers...
-
I check how my site(s) and pages look and function in all browsers, both on my iBook and using Windows 7 on my HP, as well as on my wife's (Stephanie) iPod touch (so as to know how they appear on a mobile device).
-
HTML stands for Hyper Text Mark-up Language, and was created by Tim Berners-Lee, a physicist at CERN (European Organization for Nuclear Research in Geneva, Switzerland) in 1990. As a result, he (not Bill Gates or Steve Jobs) is considered the 'father of the web'. HTML is a branch of SGML (Standard Generalized Mark-up Language, developed by IBM, ca. 1960s), which means it is meant for the Internet and the syntax of the code exists primarily as 'tags', which are commands called elements and attributes of those elements, all placed between the less-than and greater-than characters (located to the right of the letter M on your keyboard).
-
By the way, the World Wide Web, or W3 as it is sometimes called, is just one part of the Internet. Obviously, AOL (America On-line) popularized the web in the early to mid-1990s with its commercials & endless CD-ROMs in the mail, "You've got mail!" But e-mail is another part of the Internet, hence it uses a different protocol that many people do not realize is used: mailto: (instead of http://), and has been around since the 1970s. Other parts of the Internet include gopher:// (used to search stuff on the Internet), FTP (e.g., http://ftp.netfirms.com, notice the absence of 'www' in the address, ftp is file-transfer-protocol, used to upload files to the Internet), and Usenet Newsgroups (news:alt.binaries.whatever.subject), the original on-line forums for any topic.
-
Just so you know, I first got on the Internet myself in the fall of 1996...my high school (at the time) library had but one (1) computer with a 56kbps (kilo-bit per second, actually limited to 53kbps by the FCC so that land-line telephone users would not get busy signals due to the increased traffic of such connections) dial-up modem, and back then you not only sign-in, but Internet was clocked (Yes, literally timed!) and that is how you were charged on your bill (hence, the CD-ROMs that came in the mail from AOL for 24 free hours/month). The first site I visited was Yahoo! and I was fascinated that I could instantly search any person, show, movie, topic etc. and get multiple results. But I quickly realized the greater importance of one having their own presence on the Internet...therefore I began studying HTML and JavaScript.
-
HTML is a high-level formatting language (high-level, meaning the code syntax resembles regular words or at least abbreviations). All it does is design how a page will look, like arranging furniture in a room. However, HTML does not do anything (perform actions such as calculations, run decisions, etc.). For that reason, many other languages are incorporated into HTML, such as scripting languages, to do this...this way, you can play games and so on...
-
HTML is still the main programming language on the web, as it is easy to learn and use to create simple web pages within minutes. In fact, as long as you have a browser, you do not actually need to be connected to the Internet to view pages: Many of the Help topics for various software programs (such as those made by Microsoft for Windows applications) are actually HTML pages...any images used are not located on the Internet but stored somewhere on your computer!
-
HTML started with version such as 1.0 and 2.0, then 3.0, 3.2, 4.0 which marks the beginning of DHTML (Dynamic HTML) which was HTML that allowed the embedding of other programming languages (each browser had to include support for various programming languages, or that code was ignored), which made it 'dynamic.' HTML 4.1 marked the beginning of XHTML: eXtensible-HTML, which uses CSS (Cascading Style Sheets). Basically, CSS is like pre-formatted index files that many different HTML pages can refer to, thus being more efficient in saving disk space. cHTML (Compact HTML) was created several years ago for displaying Web pages written in HTML for display on various mobile devices, such as SmartPhones and PDAs (Personal Digital Assistant, like the Palm Pilot or Sony Clie), as well as for the short-lived palm-tops (small laptops made in the late '90s by Philips and others) and more recently, netbook computers (again, small laptops).
-
HTML is now up to up to version 5.0, which includes XML (eXtensible Mark-up Language, what XHTML has upgraded to). Like other SGML languages (such as MathML, used for formatting special equations and symbols to display mathematical formulas on-line), XML has its own purpose: It allows programmers to create their own tags. By doing so, the programmer declared what functions (commands, operations) the tag will perform. Then, whenever those functions are needed, you just insert that 'tag' (which is relatively short code) and therefore, again redundancy is reduced.
-
Perhaps my biggest pet peeve of any technology are incompatibilities between various browsers and operating systems. It makes using different computers and accessing content via mobile devices nearly impossible to achieve universal results...I just wish that Apple and Microsoft could do more than coexist, that content could be shared and using different computers should not be like learning to drive all over again. If you think I am wrong, just consider that Apple literally forces you to buy new products every few years as the updates on their latest stuff will be discontinued in a few more years without any support...meaning that same computer will work but will not be able to access virtually anything on the Internet or to download/connect to media content. Then consider the difficulties with iTunes songs bought/used between Windows & Mac machines...
-
I remember the early 2000s when there was only 1 or 2 Macs in the computer lab in college--"tucked" away in the corner from all the Dell and HP computers...I know because I was the only one who was using them! I even recall a tutorial video available on the desk top that teaches you how to use a Mac (yes!). I went around trying to popularize Macs when everyone was still worshiping Bill Gates (only for his billions--no one but me cared to know anything about HOW he became rich or what he actually does). Slowly but surely (that's 1 at a time) more and more Macs were appearing in the labs and (gasp) people were actually using them! After purchasing a Mac myself, I placed one of those Apple logo stickers on my bumper--and I was soon copied! Yada, yada, yada...today, Mac is so popular people aren't questioning whether it will be a $1 trillion company, but a $2-$3 trillion company! And yet, they manufacture them in China (and even underpay those workers) in a time when Americans are unemployed (and underemployed) by the tens of millions...but wait--let's mourn the death of Steve Jobs who did not even program (or do the hardware like the brilliant co-founder, Steve Wozniak)! Today, the hype over at Apple stores is that you can't get laid unless you're seen sporting that trendy Apple logo...all for what?! They are the priciest machines out there (check the records--they always have been!) so it becomes yet another status symbol (hence, the 'getting laid' appeal). Why?! Because too many young people are learning crappy programming languages (if they bother to learn anything about the products they buy) like Objective-C and others in order to design apps that require you to be connected to the Internet at all times just to access them! Then why play them from a mobile device such as an iPod Touch or iPad? If these apps are 'free' until you are hooked and feel the desire to pay for advanced features of the app, why can you not just DOWNLOAD the thing and OWN IT?! Because of GREED...for every customer lost there is two more 'dying to get laid'! So, to clarify, you play an app for free (on an iPod Touch or iPad etc. that you did pay a LOT for), but cannot access it without perfect constant connection to the Internet, each action done by you must be uploaded to the Internet so as to save that info, then when you have invested enough hours you feel it is cost effective to pay for things that do NOT cost money, like "coins" that never give you anything except virtual satisfaction...hmm...then, after a series of updates (which just eat up massive amounts of space to the tune of over 100MB/week), a new iProduct has been released--this version is called "X.0.1 above whatever you got" and is just enough to render your product obsolete...thus, you cannot connect to the Internet, and after using alternate means to contact the developers over and over again, you give up and schedule and appointment with at the Genius Bar, who act excited in order to make idiots fall for that and think they actually are geniuses, just to tell you what you already know...you must buy a new iProduct that costs as much as a mortgage payment! Yay! Let's all worship Steve Jobs so we can have promiscuous sex and do drugs and drop out of college so we can sell out to China and our souls for 30 pieces of silver (adjusted for inflation)!! If you disagree with me--wait for it--in 5 years you'll agree with me...there, that explains why. But seriously, if Microsoft operated this way, then every 3 years you would not be able to open a Word document or PowerPoint. So, (and not to praise Bill Gates--I REALLY WISH HE WOULD STAY THE HELL OUT OF EDUCATION REFORM DEBATES AS HE NEVER WENT TO PUBLIC SCHOOL AND DROPPED OUT OF HARVARD), have I made myself clear?!
What is an 'object-based' program?
-
Object-based program design attempts to deal with a program as a collection of individual parts (objects) that do different things, and not as a sequence of statements that perform a specific task. Objects of similar 'type' are grouped together as "classes" (e.g., an 'apple' object is in the 'fruit' class). Object-based languages allow you to build objects, but they don't have any built in. Because JavaScript is code that is embedded within HTML (a programming language for web browsers), there are no objects built-in.
-
However, due to the popularity in use of JavaScript over the years, all browsers include various objects in case a programmer like me decides to use JavaScript in their HTML code. (If you are unsure of what an object is, it means something like an image or a button than can be clicked.) And because JavaScript is allowed to manipulate the objects (e.g., images, text, etc.) implemented by HTML, it is considered to be an object-oriented programming language.
-
You should know that although JavaScript code can be inserted as "snippets" as part of an HTML page, you can instead create separate JavaScript pages (writing them in Notepad or TextEdit) and saving them with the extension .js which will allow you to refer to the location of that file in the HTML code, thereby letting you use the same JavaScript document for other pages as well.
JavaScript is event-driven:
-
Whenever something 'happens' on a Web page, an "event" occurs. Events pertain to the image being manipulated by the user/visitor--a button is clicked, the mouse is moved over text or another object, or when the page is loaded or when you unload a page (either via a link or by clicking the close button), or when is form is submitted, and more. JavaScript is event-driven in that it's designed to react when such an event occurs.
Are these JavaScript apps secure?
-
Yes! JavaScript is designed to manipulate and present information through the browser, but it can't retrieve information from another file or save data to the Web server or that user's computer.
-
This means it's not possible to write a JavaScript program that, say, would scan a computer's directories and retrieve, let alone erase, a user's files.
-
NOTE: However--It is possible to write JavaScript that can monitor your browser session and record where you go and what you type (e.g., a script that catches passwords for access to secure Web sites). That is why all browsers all you to disable (turn off) JavaScript, which means such code would be ignored and not run.
-
One additional note before I continue: The default setting for most browsers is to enable JavaScript, but if you have any difficulties running these scripts, please contact me by clicking the link below...in the meantime, check the settings on your browser and make sure JavaScript is not somehow turned off!
Is JavaScript platform-independent?
-
Yes! Please read my responses above about compatibility...unless disabled (which as I also stated above, can be turned back on in your browser's preferences), JavaScript works in all major browsers, both on Windows and on Mac, mobile devices and even UNIX operating system.
What JavaScript is NOT: JavaScript Isn't Java!
-
Too many people, including industry leaders, don't understand the differences between Java and JavaScript...
-
Java, developed by Sun Microsystems (now owned by Oracle), is a full-blown, object-oriented programming language, as opposed to JavaScript's compact, object-based structure (again, in short, think of object-based object-borrowing and/or object-creating).
-
Java can be used to design stand-alone (off-line) applications or to create mini-applications called "applets." This means that Java code is compiled (all code is first converted to binary/0s and 1s that computers understand and THEN it is run), which means not only is special (costly) software needed to code in Java, but the user must have software capable of running Java programs in order to view such applets. Remember that JavaScript is interpreted line by line...
-
As far as the code is concerned, JavaScript is identified within a document by the <script> tag...Java applets are embedded in a document using the <applet> tag.
-
JavaScript uses 'loose typing,' meaning that variables don't have to be declared (stated in the beginning of the code the exact 'names'/spelling of any and all variables that will be used/referred to later in the code somewhere). This also means that in JavaScript, a variable that was created 'on-the-fly' for string (alpha-numeric values) could later be used for a number...whereas Java uses 'strong typing', which means that variables must be declared and used only as a particular type (such as for handling integer values, Boolean types, etc.).
Is JavaScript still considered LiveWire?
-
NO! LiveWire and subsequently, LiveWire Pro were collections of products released by Netscape...the successor to the Netscape Navigator browser (ca. 1994-2007) was Netscape Communicator. AOL purchased the entire Netscape company and stopped development of the Netscape browsers on December 28, 2007 and discontinued support of the Netscape browsers on March 1, 2008.
-
However, you can still download archived versions of Netscape through AOL's website for use on older working machines...for example, I can still run Netscape Navigator on my iBook if I switch my operating system to Mac OS-9 (Classic view), which I can do because the hard drive on my iBook is partitioned to have both Mac OS-X and OS-9 operating systems.
References
Feather, S. (1996). Javascript by example. Indianapolis, Indiana: Que Corporation.