Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34176
| From | Dr.Kral@nyc.rr.com |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Dynamically load js files. |
| Message-ID | <ncruucl86t93a88bhbnbr4pchfe2nbmgdh@4ax.com> (permalink) |
| References | <2d97db74-9dc2-4a99-bcf8-68944b7eef51@googlegroups.com> |
| Organization | Easynews - www.easynews.com |
| Date | 2017-10-24 12:48 -0400 |
On Tue, 24 Oct 2017 04:29:18 -0700 (PDT), jonas.thornvall@gmail.com wrote
in <2d97db74-9dc2-4a99-bcf8-68944b7eef51@googlegroups.com>:
>Can you read in new js SRC files from javascript as you need them?
Yes.
I have found that this works:
var fileref=document.createElement('script');
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src","http://www.xxx.js");
document.getElementsByTagName("head")[0].appendChild(fileref);
Embed it inside a function call.
This is not my creation.
HTH
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Dynamically load js files. jonas.thornvall@gmail.com - 2017-10-24 04:29 -0700
Re: Dynamically load js files. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-24 15:00 +0200
Re: Dynamically load js files. Dr.Kral@nyc.rr.com - 2017-10-24 12:48 -0400
Re: Dynamically load js files. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-25 00:09 +0200
Re: Dynamically load js files. John G Harris <niam@jghnorth.org.uk.invalid> - 2017-10-25 15:18 +0100
Re: Dynamically load js files. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-25 17:27 +0200
Re: Dynamically load js files. John G Harris <niam@jghnorth.org.uk.invalid> - 2017-10-26 19:56 +0100
Re: Dynamically load js files. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-26 23:06 +0200
csiph-web