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

0 7665
Q:

JavaScript is designed for following purpose

A) To add interactivity to HTML Pages. B) To Execute Query Related to DB on Server
C) To Style HTML Pages D) To Perform Server Side Scripting Opertion
 
Answer & Explanation Answer: A) To add interactivity to HTML Pages.

Explanation:
Report Error

View Answer Report Error Discuss

0 7593
Q:

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

Answer

captureEvents(eventType)

Report Error

View answer Workspace Report Error Discuss

13 7587
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

0 7432
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 - Technology

0 7223
Q:

Explain in brief B2B, B2C, C2B and C2C.

Answer

- B2B (Business-to-Business)   :


In B2B, companies transact with each other. This includes the companies selling their product to wholesalers, distributors, etc


- B2C (Business-to-Consumer) :


This is usually when average businesses transact with the customer. This is done through the shopping cart softwares and the amount involved in the transactions is usually low.


- C2B (Consumer-to-Business) :


In this, a consumer places the product on the net. The companies willing to buy this product bid for it. The comsumer can then decide, depending upon the bid, which company to sell it to. 


- C2C (Consumer-to-Consumer):


These kind of transactions are usually done at an individual level. Payments can be done with the help of online systems like PayPal.

Report Error

View answer Workspace Report Error Discuss

3 7140
Q:

Which HTML attribute is used to define inline styles?

 

A) <header> B) <strong>
C) <style> D) <alt>
 
Answer & Explanation Answer: C) <style>

Explanation:

The style attribute specifies an inline style for an element. The style attribute will override any style set globally,

 

e.g. styles specified in the <style> tag or in an external style sheet.

 

Report Error

View Answer Report Error Discuss

Filed Under: Web Technology - Technology
Exam Prep: Bank Exams

7 7130
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 - Technology
Job Role: Analyst

2 7040