eduardo_bpe
eduardo_bpe

Reputation: 33

async attribute in script tag in Firefox

I'm trying to test the following code in Firefox 13.0.1, but it doesn't work correctly:

<!DOCTYPE html>
<html>
    <head>
        <title>Exercise 1</title>
        <script type="text/javascript" async src="example1.js"></script>
        <script type="text/javascript" async src="example4.js"></script>
        <script type="text/javascript" src="example3.js"></script>
    </head>
    <body>
        <p>Hello world</p>
    </body>
</html>

//example1.js:

alert("I'm the example 1");

//example3.js

alert("I'm the example 3");

//example4.js

alert("I'm the example 4");

When I open the file which contains the above html code, the following occurs:

I EDIT THE PROCESS I FOLLOW

  1. In first place, the script "example3.js" is executed, and then a pop-up with the text "I'm the example 3" appears. Afterwards, I click on OK button inside the pop-up window.
  2. In second place, the script "example4.js" is executed, and then a pop-up with the text "I'm the example 4" appears. Afterwards, I click on OK button inside the pop-up window.
  3. In third place, the script "example1.js" is executed, and then a pop-up with the text "I'm the example 1" appears. Afterwards, I click on OK button inside the pop-up window.
  4. And finally, the body content should be displayed (he paragraph with the text "Hello World"), but it doesn't in Firefox, but in Chrome. In Firefox, the page load doesn't stop.

If I open Firebug in Firefox after last script was executed, I realize that the browser does not receive the body element.

enter image description here

I don't know if my code is correct or is a bug from Firefox.

Thank you.

Upvotes: 3

Views: 1336

Answers (1)

kirilloid
kirilloid

Reputation: 14304

This is an already reported bug in firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=692754

Upvotes: 2

Related Questions