Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38370

Re: Reading a local file from an HTML page

Newsgroups comp.lang.javascript
Date 2020-04-13 12:11 -0700
References <4830286f-4484-49f8-9cda-9a4073ab6502@googlegroups.com> <fb2a3c6a-6e62-4e28-a52c-b969c3efb4cf@googlegroups.com>
Message-ID <ce760b2e-ed29-49c2-b6ec-40ed23fcc462@googlegroups.com> (permalink)
Subject Re: Reading a local file from an HTML page
From dr.j.r.stockton@gmail.com

Show all headers | View raw


On Tuesday, 7 April 2020 01:01:31 UTC+1, Michael Haufe (TNO)  wrote:
> On Thursday, April 2, 2020 at 3:29:22 PM UTC-5, dr.j.r...@gmail.com wrote:
 
> > How do I set about doing that in all up-to-date browsers, disregarding
> > IE11 and current Edge, but including the imminent new Edge?

I have now seen the new Edge.  As it does not show a HOME icon, and I could not rapidly find a way of making it show one, I have lost interest in using it.

> What is the url of the page? The following seems to work fine in IE11, Edge Brave, and Firefox:

It has no URL; all this is entirely on a Windows PC, on which the only relevant non-default applications are this page and a nice browser to run it.

> If I open the page with the file system url:
> <file:///C:/inetpub/wwwroot/iframe-test/index.html>
> 
> The loading will fail. I assume this is your problem.
> 
> Are you not using IIS?

I am not using IIS.  I would be content to not use even a browser.


What I need is

function GetDomTree(FileName) { // File will exist
  // code
  return DomTree }

or similar.

Since the current browser implementations of the "same origin" policy exclude this case of a same origin, the question has become that of whether VBScript and/or JScript natively possesses such a function or a fairly direct means of writing one; VBScript seems much better or more widely documented than JScript, but VBScript docs + ECMA 3 suffice for JScript.

I seem to recollect reading that the VBScript API(s) include a means of generating a DOM tree; if so, I just would need to know the name of the API routine, and Google should let me find the rest.

Then, I could port my JavaScript to JScript, running with WSH at the MS-DOS Command Line, or in an HTA.  I don't know how long it would take me to do that, though.

However, I now have an alternative to running this page in Windows 10 & MSIE 11; I have revived my old WinXP PC, which has Firefox 52.9.0esr, and the page works properly there.  My normal backup scheme already gets enough onto a USB stick, and the XP PC can process it there at its leisure.


But a further question, about the DOM :

I know of these >20-year-old pseudo-array properties of the document object : anchors, links, forms, images (& applets, embeds); are there now any other "similar" objects?

-- 
  (c) John Stockton, near London, UK.  Using Google Groups.           |
 Mail: J.R.""""""""@physics.org - or as Reply-To, if any.             |

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-02 13:29 -0700
  Re: Reading a local file from an HTML page minajaich@gmail.com - 2020-04-02 18:59 -0700
  Re: Reading a local file from an HTML page JJ <jj4public@vfemail.net> - 2020-04-03 20:18 +0700
  Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-03 10:57 -0700
    Re: Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-03 15:24 -0700
      Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-03 17:11 -0700
        Re: Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-04 05:41 -0700
      Re: Reading a local file from an HTML page "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-04-04 12:17 +0200
  Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-06 17:01 -0700
    Re: Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-13 12:11 -0700
      Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-14 10:04 -0700

csiph-web