Javascript language

adplus-dvertising
Javascript FAQ
previous Home Next

How to access an external javascript file that is stored externally and not embedded?

This can be achieved by using the following tag between head tags or between body tags. <script src="abc.js"></script> where abc.js is the external javscript file to be accessed.

What is the difference between an alert box and a confirmation box?

An alert box displays only one button which is the OK button whereas the Confirm box displays two buttons namely OK and cancel.

What is a prompt box?

A prompt box allows the user to enter input by providing a text box.

Can javascript code be broken in different lines?

Breaking is possible within a string statement by using a backslash \ at the end but not within any other javascript statement.that is , document.write("Hello \world"); is possible but not document.write \

("hello world");

How to hide javascript code from old browsers that dont run it?

Use the below specified style of comments <script language=javascript> <!-- javascript code goes here // --> or Use the <NOSCRIPT>some html code </NOSCRIPT> tags and code the display html statements between these and this will appear on the page if the browser does not support javascript.

How to comment javascript code?

Use // for line comments and
/* */ for block comments

Name the numeric constants representing max,min values

Number.MAX_VALUE Number.MIN_VALUE

What does javascript null mean?

The null value is a unique value representing no value or no object. It implies no object, or null string, no valid boolean value,no number and no array object.

What does undefined value mean in javascript?

Undefined value means the variable used in the code doesnt exist or is not assigned any value or the property doesnt exist.

What is the difference between undefined value and null value?

A. Undefined value cannot be explicitly stated that is there is no keyword called undefined whereas null value has keyword called null B. typeof undefined variable or property returns undefined whereas typeof null value returns object

previous Home Next