Smrita
Smrita

Reputation: 1279

Async attribute in script element not working?

When I load a script from an external server in the following manner

<div id="verisign-logo">
    <script type="text/javascript" src=verisign-url>
</div>

The script gets executed and a flash file is displayed in the div with Id verisign-logo. Verisign-url is a predefined variable.

Now I am trying to load and execute the script asynchronously.I added async attribute to the script tag in the following manner

<div id="verisign-logo">
    <script type="text/javascript" src=verisign-url async=true>
</div>

But the weird thing is script gets appened in the div however the flash file doesnot get displayed.What exactly is not right here?

Upvotes: 0

Views: 488

Answers (1)

Kamlesh
Kamlesh

Reputation: 529

With reference from w3schools syntax for async loading is as follows

<script src="demo_async.js" async></script>

W3School Async script loading

Upvotes: 1

Related Questions