0

Is it possible via javascript to change the SRC tag in <script src=""> dynamically?

Like so:

<script type="text/javascript" src="change_me"></script>
CitronAutobot
  • 255
  • 1
  • 2
  • 12
  • Why do you want to do that? I'd rather remove the script tag and add another one with the new `src`. BTW an interesting question! – Ehsan88 Aug 27 '17 at 20:44
  • The real question is indeed: what are you actually trying to achieve? – jcaron Aug 27 '17 at 20:56
  • #ehsan88 How would you go about remove and replace a script tag? – CitronAutobot Aug 27 '17 at 20:56
  • "Changing “src” attribute of – CitronAutobot Aug 27 '17 at 21:02
  • You ask: _"Is it possible via javascript to change the SRC..."_, the answer in the linked question is _"It is not possible to change the src attribute..."_. – yuriy636 Aug 27 '17 at 21:16
  • Check this link https://stackoverflow.com/questions/5235321/how-do-i-load-a-javascript-file-dynamically. And http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml – Eid Morsy Aug 27 '17 at 21:58

0 Answers0