0

I have this URL which needs to be loaded after the page has been loaded. I am trying to load the URL via Javascript like this:

<script type="text/javascript" src="//www.adtol.com/native/1/1/0/1"></script>

But, whenever I add async to this script doesn't load.

<script async type="text/javascript" src="//www.adtol.com/native/1/1/0/1"></script>

The src doesn't actually load the js file, it fetches data from server.

What can I do to load the URL asynchrounously via Javascript?

You can visit the src URL for better idea.

7
  • Do you get an error on one of your own js files when you add async? If that's the case, that's what async itself means i-e. it won't wait to load before your custom script is loaded. Commented Jun 20, 2018 at 6:17
  • 1
    "But, whenever I add async to this script doesn't load" async is supported by all major browsers (even IE11 -- actually, I think Microsoft created async). What do you mean by "doesn't load"? You get an error? You see nothing in the Network panel? I find it extremely unlikely that it just doesn't load. Commented Jun 20, 2018 at 6:19
  • See also: html.spec.whatwg.org/#attr-script-async Commented Jun 20, 2018 at 6:20
  • The src is not actually a .js file, it is URL Commented Jun 20, 2018 at 6:20
  • @EvilTech - All srcs are URLs. But your //www.adtol.com/native/1/1/0/1 returns JavaScript code, right? That's what your script tag says it does. Commented Jun 20, 2018 at 6:21

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.