Sunday, April 28, 2024
10:08 PM (GMT +5)

Go Back   CSS Forums > Off Topic Section > Computers and Technology

Computers and Technology Discuss computer issues, topics, and technology. Ask your questions about computer related problems, software, gadgets, computer science & emerging technologies.

Reply Share Thread: Submit Thread to Facebook Facebook     Submit Thread to Twitter Twitter     Submit Thread to Google+ Google+    
 
LinkBack Thread Tools Search this Thread
  #1  
Old Wednesday, February 20, 2008
pakfame's Avatar
Member
 
Join Date: Feb 2008
Location: Lahore
Posts: 82
Thanks: 0
Thanked 42 Times in 25 Posts
pakfame is on a distinguished road
Default What is JavaScript & Java

Introduction
JavaScript is a scripting language used in many websites. A scripting language is a language, which is easy and fast to learn. So is this reference. A scripting language is interpreted in run-time. It is not compiled like other languages as C++, C#, VB.NET etc. JavaScript is a client side language and it runs on the client browser. Netscape developed it and because of its simplicity it is one of the most known scripting languages. However JavaScript can be also used on the server-side. JavaScript can be used on all most known browsers. It can be easily used to interact with HTML elements. You can validate text fields, disable buttons, validate forms, or change the background color of your page. All this is possible with JavaScript. Like each programming language, it contains variables, arrays, functions, operators, objects and much more which can be help you to create better scripts for your pages. On the server side you can use JavaScript for example to manage your database entry. JavaScript code can be inserted directly in the HTML or you can place it in a separate file with the .js extension and link the web page with the .js file.

Is JavaScript a lighter version of Java?
Many who haven’t worked before with java or scripting languages think that JavaScript is the same as Java or a lighter version of it. This is not true. Java is a different language developed by Sun Micro Systems. Java is much more complex then JavaScript. In Java you have to declare each variable with the type, in JavaScript you don’t need to do that. All variables are declared when you first time use them. Furthermore in Java you have to declare all variables, functions and classes. In JavaScript you don’t even need to think about these things. Java is compiled to byte codes on the server and the result is send to the client. JavaScript is interpreted on the client side it doesn’t require any compilation.

Usage of JavaScript
Usually web-designers design pages and coders code applications. However with JavaScript a designer has the possibility to create a client side application with very less efforts. He can easily create some kind of dynamic pages – i.e.: you can easily show a prompt box and asks the user to enter his name whenever the page loads for the first time. He can then use the entered value to create a welcome string. These procedures are called events. Events can be used and called when something occurs – like loading the page for the first time. You could also write another event which is called whenever the page is closed. JavaScript is also mostly used to validate text fields. For example in asp.net you have the possibility to validate your controls with some validator controls. These validator controls are basically nothing more then a JavaScript file. This validation can be easily written with JavaScript to verify if a text field is empty or not.

Java is a technology that allows software designed and written just once for an idealized "virtual machine" to run on a variety of real computers, including Windows PCs, Macintoshes, and Unix computers. On the web, Java is quite popular on web servers, used "under the hood" by many of the largest interactive websites. Here it serves the same role that PHP, ASP or Perl might, although traditionally Java has been used for larger-scale projects.
Java can also be used to create small programs, known as "applets," to be embedded in web pages. For instance, a web page using Java could contain an interactive weather map, a live display of subway trains, or a video game, without the need for the web server to do all of the work. Unlike normal software such as .EXE files, these "applets" can not access or delete your personal files unless they ask for and are given express permission to do so. In the real world, users hardly ever give permission for this, so applets generally don't ask.
As of this writing, Java is usually (though not always) included as standard equipment on Windows PCs. If you choose to use Java applets on your site, you can invite your users to download the Java plug-in from Sun's website (http://www.java.com/en/index.jsp), using the "Get It Now" button on that site.
Reply With Quote
The Following User Says Thank You to pakfame For This Useful Post:
sibgakhan (Sunday, February 24, 2008)
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ebooks Links Predator References and Recommendations 27 Thursday, February 08, 2018 11:23 AM
C++ portability guide sibgakhan Computer Science 5 Friday, January 26, 2007 07:52 PM
Difference between Java and .Net Najabat Computers and Technology 2 Wednesday, November 15, 2006 01:19 PM


CSS Forum on Facebook Follow CSS Forum on Twitter

Disclaimer: All messages made available as part of this discussion group (including any bulletin boards and chat rooms) and any opinions, advice, statements or other information contained in any messages posted or transmitted by any third party are the responsibility of the author of that message and not of CSSForum.com.pk (unless CSSForum.com.pk is specifically identified as the author of the message). The fact that a particular message is posted on or transmitted using this web site does not mean that CSSForum has endorsed that message in any way or verified the accuracy, completeness or usefulness of any message. We encourage visitors to the forum to report any objectionable message in site feedback. This forum is not monitored 24/7.

Sponsors: ArgusVision   vBulletin, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.