Source One Educational Society Source One Educational Society
Home | OS Install | MS-Office | Photoshop | SQL | Networking | HTML | Java | Model Papers | FAQ's | Health Tips | News | Jobs | Fun SMS
Technology
 
 
 
 
JAVASCRIPT FREQUENTLY ASKED QUESTIONS
   

How do I read a file into a JavaScript variable?

Ans:)Reading a file from JavaScript is (almost) as easy as reading a file from a
Java applet. Your script cannot read files itself;you would have to code a Java
applet that reads files for your script.

In more detail, one of the possible reading mechanisms can work like this:

Your script calls a public method of the applet.

  1. The public method initiates the reading process in another thread of the
    applet, and then returns.
  2. The reading process in another thread of the applet continues. At the same
    time, the script keeps asking the applet whether the reading is complete.
  3. The applet finishes reading and puts the file content in a public string
    variable of the applet.
  4. The script sees that the applet completed reading.
  5. The script copies the file content from the applet's public variable into a
    Javascript variable.

Note that unsigned Java/JavaScript code can read files only if the file(s) to
read and the code itself have the same origin. For example, if your unsigned code is published on a Web server, it is allowed to read files from the same server only. If your code resides on the local hard disk,it is allowed to read files only from the
same disk (at best).

 
How do I write a file from JavaScript?

Ans:) Writing a file from JavaScript is just as easy as writing a file from a Java applet. Your script cannot write files itself; it should call a Java applet's public method which will actually do all the dirty file writing work for you.

The bad news is that

  1. Writing is a privileged operation, and therefore your Java applet must be
    digitally signed in order to write files.
  2. Applet signing for Internet Explorer is completely different from applet signing for Netscape Navigator.
  3. Signed applets may not work properly in Netscape Navigator 3.
  4. What's the worst, it's very insecure to put privileged operations in public
    methods of signed applets! If you publsh such an applet, a malicious code could
    easily subvert the applet's public methods, and you (the applet publisher/signer)
    will be sued for any damage!

Therefore, nobody publishes scripts that write files via signed applets, although in versions 4 of both major browsers it's technically possible.

 
Which browsers support JavaScript?

Ans:) JavaScript is supported by the following browsers:

  • Netscape Navigator (beginning with version 2.0)
  • Microsoft Internet Explorer (beginning with version 3.0)
  • Any other browser/product whose vendor licensed or implemented JavaScript
    interpreter (for example, Opera).
 
What JavaScript versions are there?

Ans:)JavaScript is one of the youngest programming languages. It was first
implemented by Netscape Communications in 1995.The first browser to support
JavaScript was Netscape Navigator 2.0 beta version. By 1999 the two major
browsers,Netscape Navigator and Microsoft Internet Explorer,supported the following
client-side versions of JavaScript:.

Browser javaScript Version
Year
Netscape Navigator 2.0
JavaScript 1.0
1995
Microsoft Internet Explorer 3.0
JavaScript 1.0 (JScript 1.0)
1996
Netscape Navigator 3.0
JavaScript 1.1
1996
Netscape Navigator 4.0
JavaScript 1.2
1997
Microsoft Internet Explorer 4.0
JavaScript 1.2 (JScript 3.0)
1997
Netscape Navigator 4.5
JavaScript 1.3
1998
Microsoft Internet Explorer 5.0
JavaScript 1.3 (JScript 5.0)
1999
 
 
 
 
 
Quick Links
Java FAQ's
XML FAQ's
.Net FAQ's
Javascript FAQ's
 
 
 
 
 
Home  |  Aboutus  |  Post Your Content  |  Tell a Friend  |  Contact us  |  Sitemap
© 2009 365edu. All Rights Reserved. Site by 365edu. Best view in 1024x768 resolution.