In message <11*********************@e3g2000cwe.googlegroups.c om>, Wed, 8
Nov 2006 15:39:30, nick <wa*****@gmail.comwrites
>Is it possible to dump the source code from a .js file and save it to a
string?
Don't know; but I'd use it if I could.
The source, or functional equivalent, of a function Fn [in a .js file],
can be obtained by Fn.toString() - therefore, if you can put the whole
needed content in the .js file as a function Fn, you can do what you
want, more or less.
The green-bordered boxes in
<URL:http://www.merlyn.demon.co.uk/js-nclds.htm get their contents via
Fn.toString(), and the section "Code Display" shows how.
Query : how necessary is it for an include file to be named *.js ? I
find that to have mildly annoying consequences now that the OS
recognises .js as an executable extension.
It's a good idea to read the newsgroup and its FAQ. See below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.