0

I want to load a javascript file in html and make the javascript file dynamic, so if it is requested as:

'<script src="somefile.js?load_iframe=1"></script>'

it should do a function called :

function load_iframe() {
    alert('iframe function executed');
    //some more functions
}

and when the scripts does not get the 'load_iframe' parameter it should not execute the above function

The main idee is to get the requested url of the script within the script itself.

Is some kind like this possible to create with javascript, maybe with a js-library?

Sake Salverda
  • 625
  • 1
  • 6
  • 17

0 Answers0