Writing data in files at client machine using javascript in chrome
Hi,
I want to write a file using javascript at client machine using chrome.
Chrome doesnt allow activeX object. however there are add ons to counter the issue.
The requirement is writing a file without using addon.
Kindly suggest.
JavaScript running in the browser does not have any commands for reading or writing files. JavaScript is a client-side language; modern browsers can read files on the server using an Ajax call, but otherwise JavaScript has no capability to read from, write to or delete any file (except a cookie).
MSIE (only) can write to files ON THE USER'S COMPUTER (only), but only if the user marks your site as being a "safe" site and only if he/she agrees to let your page run an "unsafe for scripting" ActiveX control.
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
@pm: you have less than a month before i start calling you out on that because Chrome, FireFox and IE will all support forced downloads.
Yes, but not existing versions of those browsers.
There is no point in coding for IE10 (only) while plenty of people are still using IE9, IE8, IE7 and even IE6.
You obviously revel in the very latest technology, but I live in the real world where lots of people are still several years behind the latest innovations.
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Yes, but not existing versions of those browsers.
There is no point in coding for IE10 (only) while plenty of people are still using IE9, IE8, IE7 and even IE6.
You obviously revel in the very latest technology, but I live in the real world where lots of people are still several years behind the latest innovations.
well, if 51% of browsers could force a download, one could say your orig answer was mostly wrong. As it stands, by statcounter, you're at least 95% wrong...
you said yourself that old IE can already do this, and now, so can everyone else...
it's like your arguments are "only old IE machines can do that" and "only new machines can do that", which doesn't make a whole heck of a lot of sense, does it?
surely if most devices can do this, your warning text should be altered from the blanket denial you've been using since forever ago.
otherwise, it seems like you are defining javascript capabilities based a small minority of users, not the vast majority of available clients.
to me, the word "can't" implies the current state of affairs, whereas "counldn't" is probably a more accurate match for your overall message.
__________________ my site (updated 5/13) STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
So... phone/mobile usage (which is almost surely all HTML 5 or close to it) is more than all MSIE combined.
Hmmm...
(By the by, the total pagehits includes web crawlers--google, yahoo, bing, etc. At a first cut--without refining the data more--it looks like only 93,000 of the page hits were actually from browser usage. So the percentages shown can be roughly doubled to reflect browser-only usage. Sometime I'll refined the data more carefully, but not now.)
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Last edited by Old Pedant; 03-07-2013 at 09:20 PM..