Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #13073
| From | Dr J R Stockton <reply1213@merlyn.demon.co.uk.not.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: javascript |
| Date | 2012-03-26 20:44 +0100 |
| Organization | Home |
| Message-ID | <KeRNu2DNcMcPFwmd@invalid.uk.co.demon.merlyn.invalid> (permalink) |
| References | <31677fea-c30c-4bd3-9735-3aefe08f174d@z3g2000pbn.googlegroups.com> <4f6ee117$0$12526$ba4acef3@reader.news.orange.fr> |
In comp.lang.javascript message <4f6ee117$0$12526$ba4acef3@reader.news.o range.fr>, Sun, 25 Mar 2012 11:10:47, SAM <stephanemoriaux.NoAdmin@wanad oo.fr.invalid> posted: >Le 25/03/12 09:29, naveen raj a écrit : >> how to read from a file in the script ? > >not possible I do it, literally almost every day. Shortly after 18:00 LCT for one reason, and irregularly for others. With a browser, an HTML or TXT file (and maybe other types) from the same domain (including the local disc (except in Chrome (unless they've recently fixed it))) into an iframe element and its content can then be accessed. An HTML file just adds to the DOM tree as a branch; a TXT file as a string. // Ifr is a reference to the iframe: FILE = Ifr.contentDocument.body FILE = FILE.textContent || FILE.innerText // IE8 needs latter // FILE is now a string. This newsgroup is not solely for Web authoring or using browsers like Firefox. It also covers MS IE, in which a .HTA file can access the local disc in full with VBscript or JScript, with a Web-like display. It also covers Windows Scripting Host, in which a script can access the local disc in full with VBscript or JScript, with a Command Prompt display. It also covers anything that may be equivalent in Mac, UNIX, or other non-Windows systems. But, in a Web page, one cannot read the innards of anything other than same-domain material - AFAIK, it's not allowed and should not be possible. -- (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
javascript naveen raj <naveenrajp.erode@gmail.com> - 2012-03-25 00:29 -0700
Re: javascript SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-03-25 11:10 +0200
Re: javascript "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-25 16:00 +0000
Re: javascript Dr J R Stockton <reply1213@merlyn.demon.co.uk.not.invalid> - 2012-03-26 20:44 +0100
Re: javascript Scott Sauyet <scott.sauyet@gmail.com> - 2012-03-25 07:03 -0700
csiph-web