Please, do tell us how you imagine that to work? How would you get the contents of pure JSON file when you load in your browser through a external script tag.
On Thursday, August 1, 2013 at 11:14 AM, [email protected] wrote: > Use this instead: > var oHead = document.getElementsByTagName('HEAD').item(0); > var oScript= document.createElement("script"); > oScript.type = "text/javascript"; > oScript.src="http://domain.com/jsonfile.json"; > oScript.onload = function(){ > alert("Done"); > } > oHead.appendChild( oScript); > > On Wednesday, July 31, 2013 10:42:03 PM UTC+2, ryandesign wrote: > > On Jul 31, 2013, at 11:56, Michael Ryan wrote: > > > > >> I know how to use XMLHttpRequest and have already written a loadFile > > >> function using it. But that's only necessary when running in a browser. > > >> I have found XMLHttpRequest implementations for node in npm which I > > >> could include, but all I really want when running in node is for > > >> loadFile to load the file from the local filesystem using fs.readSync or > > >> equivalent. > > > > > > So, why not use fs.readSync? > > > > In node, I probably will. > > > > In the browser, there is no fs module and indeed no filesystem. The > > compatibility modules for fs that I've found use the new HTML5 local > > storage, which is not what I'm after. > > > > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > (mailto:[email protected]) > To unsubscribe from this group, send email to > [email protected] > (mailto:[email protected]) > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > (mailto:[email protected]). > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
