JavaScript Statements
Posted by Dave in JavaScript, Statements on March 16th, 2009
A JavaScript statement is a command to the browser and the purpose of the command is to tell the browser what to do.
JavaScript statements have to be separated by either a semi-colon or by placing the following statement on a new line.
However, it’s good practice to do both to ensure that the statements are executed separately.
Here's a statement;
And here's another statement;
I’m sure that I’ll be investigating JavaScript statements further and understanding more about them but for anyone that wants to skip ahead of me now and read more about them, then there’s a decent looking article on the subject below.
JavaScript Alert
Posted by Dave in JavaScript on March 15th, 2009
JavaScript alerts can be useful for providing feedback when validating form fields. As I learn a bit more about JavaScript, I’m sure that I’ll come across some nice jQuery solutions that are much nicer than a simple alert but I think that it’s probably useful to also understand the very basics of the language before delving into the more complex solutions so:
<script type="text/javascript">
alert("Hello World!");
</script>
And that’s it. As I’ve mentioned in my previous article, it’s also worth considering how this will work for any users that don’t have JavaScript available as some kind of server side validation would also be required. But having said that, there’s no reason why you shouldn’t serve this message up as a message on the client side where users have JavaScript available.
Understanding the Basics
Posted by Dave in JavaScript on March 15th, 2009
Coming from a web design background, I already understand the role that JavaScript plays when building a website and how it works but have always relied on others to actually do the implementation. This quick introduction will briefly explain how and when JavaScript should be used and the best method for including it within a page.
Welcome to Teach Me JavaScript
Posted by Dave in JavaScript on March 15th, 2009
Teach me JavaScript is a project to document the JavaScript learning process that I go through in order to help others who are also trying to take their first steps into programming languages.
I’m an expert in web design, HTML, CSS and SEO and whilst I have a basic understanding of programming languages, JavaScript is the next language I’ve decided to take an extensive look at. Hopefully, others who are interested in the JavaScript language (and JavaScript frameworks including jQuery) will be able to follow along or pick up some useful tips as they also learn JavaScript.
JavaScript Comments
Posted by Dave in JS Comments, JavaScript on March 16th, 2009
This is something that I already understood partly through my exploration with PHP and also because of CSS but thought it was also worth documenting for anyone that wasn’t aware of both methods of writing comments within a JavaScript file.
Read the rest of this entry »
No Comments