Web Technology Questions

Q:

How do you create a new object in JavaScript?

Answer

var obj = new Object(); or var obj = {};

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1560
Q:

What is the difference between JavaScript and Jscript?

Answer

Both JavaScript and Jscript are almost similar. JavaScript was developed by Netscape. Microsoft reverse engineered Javascript and called it JScript.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1557
Q:

What is Javascript namespacing? How and where is it used?

Answer

Using global variables in Javascript is evil and a bad practice. That being said, namespacing is used to bundle up all your functionality using a unique name. In JavaScript, a namespace is really just an object that you’ve attached all further methods, properties and objects. It promotes modularity and code reuse in the application.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1552
Q:

What is a CDATA section in XML?

Answer

CDATA - (Unparsed) Character Data


The term CDATA is used when you dont want some text data to be parsed by the XML parser.


A CDATA section starts with "<![CDATA[" and ends with "]]>": 

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1550
Q:

What is decodeURI(), encodeURI() in JavaScript?

Answer

To send the characters that can not be specified in a URL should be converted into their equivalent hex encoding. To perform this task the methods encodeURI() and decodeURI() are used.


For example, the following code snippet performs the encoding of URL:


<script type="text/javascript">


          var uri = https://www.mysite.com/city?=Banglore; // original URI


          var ncodeuri=encodeURI(uri);


          document.write("<br />ncodeuri”);


          var dcodeuri = decodeURI(ncodeuri); 


          document.write(“<br>/>dcodeuri”);


</script>

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1546
Q:

What is the advantage of using frames?

Answer

- Frames make it easier to navigate through a site. 


- The links that appear in the frame can appear through out the site.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1530
Q:

What is Shift() method in Javascript?

Answer

-The shift() method is similar as the pop() method but the difference is that Shift method works at the beginning of the array. 


-The shift() method take the first element off of the given array and returns it. The array on which is called is then altered.


For example


var myarray = ["apple ", "banana ", "mango "]; 


console.log(myarray.shift());


console.log(myarray);


we get the following console output:


apple


["banana ", "mango "];


 


When we call shift() on an empty array, it will return an undefined value.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1525
Q:

What does isNaN function do?

Answer

It Return true if the argument is not a number.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 1518