0

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?

6
  • that is what asych is supposed to do. Commented Jan 1, 2014 at 5:32
  • @pilot hey there I dont get you Commented Jan 1, 2014 at 5:34
  • 1
    I think your flash stuff requires script which you are loading asynchronously ..SO you cannot guarantee it will be available at the time you expect flash to work.. Commented Jan 1, 2014 at 5:36
  • You're missing </script>. Is that a copying error or in your real code? Commented Jan 1, 2014 at 5:37
  • @Pilot The flash image is returned by the script that I am loading. Commented Jan 1, 2014 at 5:39

1 Answer 1

1

With reference from w3schools syntax for async loading is as follows

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

W3School Async script loading

Sign up to request clarification or add additional context in comments.

3 Comments

As far as I know that's what HTML5 compatible browsers accept what about browsers that donot support HTML 5?
Then you required to specify that condition while asking question
Thanks for pointing that out.I was in a hurry my bad.But you seem to be an extremely smart guy why didnot you make sure before answering?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.