Javascipt Today
This morning I'm going to be working on my website-business website some more. This time, I think I'll be working with Javascript. If you're not into techno-geek-stuff, you might want to skip this posting. GRIN! But I'm going to try to explain the code-level mechanics of how websites work so most anyone can understand it. Let me know if I succeeded.
A different "language," PHP, the thing I've been working on most recently before now, is a "server-side scripting language." That is, when the client browser sends a request for a web page to the server, the server then runs a PHP script to build the page at that time and send it back to the client. This is good because it allows you to build a lot of flexibility into the web pages, they can be built dynamically, at the time they are requested, based on what is requested. However, once the page is sent over the internet to the client, the server can't do anything else until the client sends another request. (Well, technically, that's not true, but for this discussion, let's assume it is.)
Javascript is a "client-side scripting language." This means that when the server serves up the web page to the client, it also sends the javascript with it, and if the user makes a certain "request" (such as running a mouse cursor over a button), the javascript runs from right inside the client's browser, without sending any information back and forth across the internet. The pros and cons of this are that it works much more quickly, because the code is resident right there on your computer, but it also means you send more code with the web page, and it takes it a bit longer to load. If you ever rolled your mouse cursor over a menu button and it automatically dropped down to show you some sub-menu items, that's done with javascript.
Javascript is very similar to, but still some different from PHP, in syntax and keywords and structure. I've got to be very careful not to mingle the two. If I do, the code won't work.
Several years ago, maybe about 2001 or earlier, I determined there are FIVE key tools I'd need to building any website I want, no matter how complex. These components are (1)HTML. This is the main type of code that renders any webpage in a browser. The TAGS we use for font color, boldface, etc. are part of HTML. (2)CSS, or Cascading Style Sheets. I've done some studying on these, and would estimate my fluency level at maybe 50%. CSS allows you to have one document that tells an entire website how to look. If you want to change anything about the look of a website, such as the background color, the font face, size, or color of any tag element, you only have to do it in one place, the CSS, and it will apply to all the pages in the website. (3)PHP. You know now that's the server-side scripting language. (4)Javascript, of course, the client-side scripting language. And (5)MySQL. This is the database engine that will allow you to store and retrieve massive amounts of information. For example, when you go to Amazon and look for books on a certain subject, their client-side scripting language dynamically builds a query ("Show me all the books we have where the subject or title includes anything about ulcerative colitis") and sends it to their database, which returns the results you see on your screen.
The really cool thing about all five of these tools or languages is that ALL of them are totally free, as are the tremendous boatload of tutorials and ready-to-go-libraries and tools that are also available. But despite the fact that these are all free, they are quite reliable and robust. Many very high-level corporate websites are built on nothing more than this.
So I've been "gently" studying HTML for over ten years; I've been poking at CSS for over five years, I'm getting better now at both PHP and javascript, and the only thing I have left to sink my teeth into in a big way is MySQL. I have a feeling that if I start getting in a number of website clients, I'll really escalate my learning curve on all of these. But for now, I'm doing it only for my own learning.
One good thing about learning the database segment of this: I was a very fluent professional database application developer for over six years, and I have a very good working intimacy with database concepts. So I won't have to scale THAT mountain to learn this segment, only the part of it where I learn the ideosyncracies of this particular flavor of it, how to phrase things, how to send queries, what to do with the information I get back, etc.
So javascript is what's on my plate today. My objective is to upgrade my contact form on my website design site (http://www.dmillerweb.com/contact/contact03.php) so that it checks to see someone has entered SOMETHING in the name field and comments field, and a valid email address in that field as well. I want it to alert the user before leaving the page if anything is incorrect there. I also want it to check that there is nothing but numbers (a minimum of 7 - or should I make it 10) and dashes and parentheses in the phone field, but make it okay to leave that field blank. That's the objective. Now let's see if I can make it happen.
- dpm39560's blog
- Login or register to post comments
