Remember Me
forgot your password?

JavaScript Programming For Absolute Beginners

Chapter 1: Variables, Inputs & Outputs

Programming is nothing more than controlling in a more direct way what P already use a computer in a number of ways, you want your computer to do. You proband you control it to some extent by the programs you use and the way that you use them. Still, without programming, you are always at the mercy of the programs designed by others. In this chapter, you will look at how you can begin to influence the computer’s behavior. Specifically, you will:

• Examine how you can put code inside a HyperText Markup Language (HTML) page

• Use dialog boxes to interact with the user • Learn how computers store data in variables

• Learn how to get data from the user

• Perform basic operations on data

Adding Code to HTML

Web pages provide a rich background for programming. With the knowledge of HTML that you already have, you can generate pages that look pretty good. For example, you can control how text looks and add images. You might even have some experience with the finer-grained control of cascading style sheets. Still, plain HTML pages lack true interactivity. The only way that the user can really exert any control over the page is by clicking on links. This is interesting, but that fun takes the user only so far.

Creating the Hello, World! Application

It would be interesting to make the page a little more dynamic. Both of the major browsers, Netscape Navigator and Microsoft Internet Explorer, support JavaScript, a scripting language that is perfect for adding interactive features to a Web page. Take a look at the following snippet of code: 3 Chapter 1 Variables, Input, and Output

<html>

<script>

//hello world

//the classic first program

alert("hello world");

</script>

</html>

If you save this code as a Web page, then load that page into a browser, it generates the screen shown in Figure 1.2. This code snippet consists of normal (if very abbreviated) HTML, but it uses some features you might not have seen before. The <script></script> tag set specifies to the browser that any code between the tags is not written in HTML, but in a scripting language. Both the Netscape Navigator and Microsoft Internet Explorer browsers use JavaScript, their default language, unless you specify another language. (Technically, Microsoft Internet Explorer runs a variant called Jscript, but the code works the same as either JavaScript or Jscript.)

So much for now folks, stick around for more JavaScript programming tutorials.

Stunner

For more on Javascript programming and online entertainment, visit my site: Http://funaddict.yolasite.com For more on writing effective articles visit: http://effective-articles.blogspot.com

Rate this Article: 0 / 5 stars - 0 vote(s)
Print Email Re-Publish

Add new Comment



Captcha

  • Latest Programming Articles
  • More from Stunner

Websites Development: Make Your Presence Felt in the Online World

By: Arun Kumar | 01/01/2010
For corporate enterprises, these companies offer a site development which can give a strong corporate identity for your business which has the potential to impress potential clients, partners, and customers. For small businesses, the designs offered are usually affordable and customizable with easy site navigation.

How to Locate and Make the Most of an iPhone Web Development Company?

By: Arun Kumar | 01/01/2010
By installing the iPhone apps, be it the web based or the business or entertainment based, you can easily broaden your wings of achievement all easily. All sorts of iPhone apps are now becoming extremely popular because of their ease of use. They can be easily downloaded from the web just by paying a very reasonable amount to the developers.

Integrating facebook in cakephp

By: Digisha Modi | 30/12/2009
FaceBook Application is the powerful tool of marketing or to connect people for all type of business. Now it's easier to find social applications on Facebook, on your phone, and on external websites. The new "Featured by Facebook" section highlights Facebook's favorites. Since 2007 the kind of concept FaceBook has come up with become a unique challenger to established payers. The benefit of FaceBook application is any one can post their own application with out any cost.

Outsourcing of iPhone Application Development Offers Profits for Developers as Well as Users

By: Arun Kumar | 30/12/2009
Being a 3G phone, it offers users the advantage of thrilling web access which helps them being on top of all online activities even on the move. Also, there are several additional applications available for download for the device. Thanks to the efforts of the outsource iPhone application development firms which have helped iPhone users get more with their devices using the apps developed by their expert developers.

Magento Template Integration

By: Digisha Modi | 30/12/2009
If you have purchased Magento template or simply need to integrate an existing graphic design template into your e-commerce shop we will integrate it into Magento for you. A web template is a ready- made web design need to be integrated. Usually web templates make possible a standardized layout (page arranging, colors, positions, etc.) for different web contents while using the same basic layout.

Magneto Template Designing

By: Digisha Modi | 30/12/2009
If you want your magento store to be very attractive and user friendly then we at Biztech Consultancy do it for you. We help in customizing the appearance of your Magento e-commerce store with Magneto’s powerful theming engine. Basically Magento theme is combination of layout, template and/or skin file(s) that create the visual experience of your store.

Pass4side 000-135 practice test

By: Adela1987 | 30/12/2009
Pass4side 000-135 Details: Pass4side is your source for the IT Exam 000-135 exam. With our 000-135 Exam Resources, you can be rest assured that you will Pass your 000-135 Exam on Your First Try. Our Exams are written and formatted by Top senior IT Professionals working in today is prospering companies and data centers. All of our practice exams including the IBM 000-135 exam guarantee you success on your First Try. 000-135 is a challenging exam,with our 000-135 study guide,you can feel safe wit

Open Source Development

By: Digisha Modi | 30/12/2009
Open Source Software are free applications released under special licensing terms where the core coding is viewable and able to be edited to suit the needs of the user. Open Source applications cover a myriad of uses - from entertainment to enterprise ecommerce. Open source software like Joomla, magento and osCommerce are very popular and widely used. They are content management system and it maintains track of every piece of content including music, videos, text, widgets, images and documents.

Hooked: New Science on How Casual Sex is Affecting Our Children

By: Stunner | 13/09/2009 | Parenting
You may recall that several years ago President George W. Bush appointed Joe Mcllhaney, a well-known advocate of abstinence-only programs, advisor to the CDC.In April 2002, Mcllhaney testified to Congress that there was no evidence that comprehensive sexuality education programs are "successful at all" ....

JavaScript Programming For Absolute Beginners

By: Stunner | 03/09/2009 | Programming
The purpose of this book is to teach you the main principles of programming. You will learn the major concepts used in most programming languages, and you will apply them specifically in JavaScript. I will use the context of game programming to teach the concepts, but you will find that you can use the techniques for purposes far beyond game programming. If you already know JavaScript, you will still probably find some new ideas in the descriptions of game programming.

Writing the Article Middle Section

By: Stunner | 21/08/2009 | Tutoring
So you're of to a flying start and managed to hook the reader early on, but what next ?.... read on

Effective Articles - Writing an Introduction

By: Stunner | 07/07/2009 | Writing
At various educational institutes, your tutors must have given you conflicting or even confusing instructions on how to navigate around a vital stage in your article, that is, writing an introduction for an effective article... Read on for the complete discourse.

Submit Your Articles Free: Signup
Article Categories




Use of this web site constitutes acceptance of the Terms Of Use and Privacy Policy | User published content is licensed under a Creative Commons License.
Copyright © 2005-2008 Free Articles by ArticlesBase.com, All rights reserved. (0.28, 6, w3)