how to write text to file using JavaScript

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
11,291
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 3, 2008

Write a character or a text to a file using JavaScript

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (10)

Sign In or Sign Up now to post a comment!
  • @liamsyt1

    oh cool

  • wow that was easy and will be very useful, thanks for a quick and dirty intro into the filesystemobject got any crash courses on rendoring the data back into a file?

  • Internet Explorer will run this code (most browsers can be set to allow javascript to run) though you are correct in stating it can be run outside of a browser. But the use of ActiveX objects restricts it to the Windows operating system.

  • Line 1 creates the variables.

    Line 2 creates a file system object

    (the user will receive a warning message and be required to authorize the ActiveXObject)

    Line 3 invokes a method in the file system object "CreateTextFile") - this actually creates the test file, "a.txt"

    Line 4 writes the letter A and a newline character into the just-created file, using the object's WriteLine() method.

    Line 5 closes the file using the object's close() method.

    This only works in Internet Explorer on Windows.

  • What does it do ??? =)

  • yea if you consider that... in fact writes a text file, usually in %C:%\Document and settings\%user%

  • mm, alright, i ran it, but it doesnt do anything

  • okay...what does it do? does it screw up the computer or what? im a little scared to run this thing...

  • what does it do

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more