Web Technology Questions

Q:

How to read and write a file using javascript?

Answer

Files can be read and written by using java script functions – fopen(),fread() and fwrite().


The function fopen() takes two parameters – 1. Path and 2. Mode (0 for reading and 3 for writing). The fopen() function returns -1, if the file is successfully opened.


Ex: file=fopen(getScriptPath(),0);


 


The function fread() is used for reading the file content.


Ex: str = fread(file,flength(file));


 


The function fwrite() is used to write the contents to the file.


Ex(): file = fopen("c:\MyFile.txt", 3);// opens the file for writing


fwrite(file, str);// str is the content that is to be written into the file.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 5887
Q:

The syntax of capture events method for document object is..

Answer

captureEvents(eventType)

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

13 5759
Q:

What is mean by "this" keyword in javascript?

A) It refers current object B) It referes previous object
C) It is variable which contains value D) None of the above
 
Answer & Explanation Answer: A) It refers current object

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Web Technology

0 5523
Q:

Does javascript have the concept level scope?

Answer

No. JavaScript does not have block level scope, all the variables declared inside a function possess the same level of scope unlike c,c++,java.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 5495
Q:

The Internet was launched in 1969 and was originally called ?

A) AARPNET B) CERNET
C) ARPANET D) CERN
 
Answer & Explanation Answer: C) ARPANET

Explanation:

The Internet was originally called Advanced Research Project Agency Network (ARPANET).

Report Error

View Answer Report Error Discuss

Filed Under: Web Technology
Job Role: Analyst

2 5244
Q:

Explain about AngularJS boot process.

Answer

When the page is loaded in the browser, following action takes place:


HTML document is loaded into the browser, and evaluated by the browser. AngularJS JavaScript file is loaded; the angular global object is created. Next, JavaScript which registers controller functions is executed.


AngularJS scans through the HTML to look for AngularJS applications and views. Once view is located, it then connects that view to the corresponding controller function.


Then, AngularJS executes the controller functions. It then renders the views with data from the model populated by the controller. The page is ready.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 5117
Q:

How do we create a DHTML drop-down menu?

Answer

- In order to create a DHTML drop down menu we need JavaScript API. The API (Application Programming Interface) consists of core set of cross-browser JavaScript functions to make DHTML programming easy and quick. This API enables moving and hiding page elements as well as acts as getter and setter of page elements attributes.


- Second we define on image object and off image object and string containing the URL of the "off" version.


- Then we create the menu items, label items and sub-menu items. If we wish we can use images also.


- Then we need to define our own global variables that will be used by the menu. Using global goes against oops design but makes sharing data easier.


- Create the menubar object, adding the menu labels and writing menubars.


- Create menu object, adding menu items and writing menus.


- Hiding and displaying the menus and attaching stylesheet.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

5 5078
Q:

What happens if the list-style-type property is used on a non-list element like a paragraph?

Answer

Here the property will be ignored without having any effect on the paragraph.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

3 5064