Wednesday, December 31, 2008

All Basic Things About Java Script

1. How to declare the methods in Javascript?


Methods are the actions that can be performed on objects.
Example:
script type=”text/javascript”>var str=”Hello world!”
document.write(str.toUpperCase())
In the above example UpperCase() method is used to print the string in Uppercases.

2. How do I print JavaScript output?
JavaScript programs cannot directly access printers. However, the user can print out everything on the Web page, including the output of JavaScript programs, by using the File | Print menu of the browser. How can I prevent an html page from being printed by a browser? Include a style sheet reference or a style sheet section with a media type of print. Set a rule for BODY with one entry, display:none.
3. Difference between Java Script and Vb Script?

Vb Script : Java Script :
1. Vb script will be run on IE
2. Vb script is developed by ms
3. Vb not case sensitive

1. Javascript runs on any browser
2. Java script by Sunmicrosystems
3. Java is case sensitive

4.How can JavaScript make a Web site easier to use? That is, are there certain JavaScript techniques that make it easier for people to use a Web site?


JavaScript's greatest potential gift to a Web site is that scripts can make the page more immediately interactive, that is, interactive without having to submit every little thing to the server for a server program to re-render the page and send it back to the client.

For example, consider a top-level navigation panel that has, say, six primary image map links into subsections of the Web site. With only a little bit of scripting, each map area can be instructed to pop up a more detailed list of links to the contents within a subsection whenever the user rolls the cursor atop a map area.

With the help of that popup list of links, the user with a scriptable browser can bypass one intermediate menu page.
The user without a scriptable browser (or who has disabled JavaScript) will have to drill down through a more traditional and time-consuming path to the desired content.

No comments: