Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

75 of 103 people (73%) answered Yes
Recently 7 of 10 people (70%) answered Yes


Can Javascript save the view source into a text file without the dialog box or launching notepad?

Apr 7th, 2008 23:36
ha mo, Colin Fraser, Dave Joseph,

This is for security reasons as much as anything else. How would you
feel if someone coded a page that wrote a file to your hard drive
without you being aware of it being there. How do you know what is in
the file? More importantly, what if you have a particular folder in a
particular place on your hard drive for a particular reason, and someone
writes another file to that folder? 
It is also a matter of practicality, how do you know where to put the
file if somone is using Linux, someone else is using Windows, and
someone else is using MacOSX or an earlier version of the MacOS?  You
can make guesses, and you can detect the OS of the computer, but Macs
and PCs, so I am told, use different formats for all their files, even
text files. So you than need to make sure there are two versions of the
same file, one Mac one PC, and that does not even begin to get into the
older OS's or the newer ones.    
For me, this is a nightmare of some very complex and involved coding
that would be more trouble than it is worth. Just one more thing,
Javascript was deliberately written not to include any clientside file
handling, so you cannot write anything other than cookies to the user's