*Operators are without the parenthesis.
This can be done by including the name of the required frame in the hyperlink using the ‘target’ attribute.
<a href=”newpage.htm” target=”newframe”>New Page</a>
What is the role of break and continue statements?
Break statement is used to come out of the current loop while the continue statement continues the current loop with a new recurrence.
Write the point of difference between web-garden and a web-farm?
Both web-garden and web-farm are web hosting systems. The only difference is that web-garden is a setup that includes many processors in a single server while web-farm is a larger setup that uses more than one server.
How are object properties assigned?
Assigning properties to objects is done in the same way as a value is assigned to a variable. For example, a form object’s action value is assigned as ‘submit’ in the following manner – Document.form.action=”submit”
fh = fopen(getScriptPath(), 0);
DOM stands for Document Object Model and is responsible for how various objects in a document interact with each other. DOM is required for developing web pages, which includes objects like paragraph, links, etc. These objects can be operated to include actions like add or delete. DOM is also required to add extra capabilities to a web page. On top of that, the use of API gives an advantage over other existing models.
Events are the actions that result from activities, such as clicking a link or filling a form, by the user. An event handler is required to manage proper execution of all these events. Event handlers are an extra attribute of the object. This attribute includes event’s name and the action taken if the event takes place.
By default, the parsing of the HTML code, during page loading, is paused until the script has not stopped executing. It means, if the server is slow or the script is particularly heavy, then the webpage is displayed with a delay. While using Deferred, scripts delays execution of the script till the time HTML parser is running. This reduces the loading time of web pages and they get displayed faster.
Nested functions: The functions, which are defined inside other functions, are called Nested functions. They are called ‘everytime’ the main function is invoked.
- Load-time errors: The errors shown at the time of the page loading are counted under Load-time errors. These errors are encountered by the use of improper syntax, and thus are detected while the page is getting loaded.
- Run-time errors: This is the error that comes up while the program is running. It is caused by illegal operations, for example, division of a number by zero, or trying to access a non-existent area of the memory.
- Logic errors: It is caused by the use of syntactically correct code, which does not fulfill the required task. For example, an infinite loop.
What are Screen objects?
Screen objects are used to read the information from the client’s screen. The properties of screen objects are –
- AvalHeight: Gives the height of client’s screen
- AvailWidth: Gives the width of client’s screen.
- ColorDepth: Gives the bit depth of images on the client’s screen
- Height: Gives the total height of the client’s screen, including the taskbar
- Width: Gives the total width of the client’s screen, including the taskbar
Explain the unshift() method ?
This method is functional at the starting of the array, unlike the push(). It adds the desired number of elements to the top of an array. For example
var name = [ “john” ];
name.unshift( “charlie” );
name.unshift( “joseph”, “Jane” );
The output is shown below:
[” joseph “,” Jane “, ” charlie “, ” john “]
Define unescape() and escape() functions?
The escape () function is responsible for coding a string so as to make the transfer of the information from one computer to the other, across a network.
document.write(escape(“Hello? How are you!”));
The unescape() function is very important as it decodes the coded string.
It works in the following way. For example:
Output: Hello? How are you!
What are the decodeURI() and encodeURI()?
EncodeURl() is used to convert URL into their hex coding. And DecodeURI() is used to convert the encoded URL back to normal.
var uri=”my test.asp?name=ståle&car=saab”;
innerHTML content is refreshed every time and thus is slower. There is no scope for validation in innerHTML and, therefore, it is easier to insert rouge code in the document and, thus, make the web page unstable.
What does the following statement declares?
var myArray = [[]];
It declares a three dimensional array.
Namespacing is used for grouping the desired functions, variables etc. under a unique name. It is a name that has been attached to the desired functions, objects and properties. This improves modularity in the coding and enables code reuse.
Add “<!–” without the quotes in the code just after the <script> tag.
Add “//–>” without the quotes in the code just before the <script> tag.