Closed Bug 311276 Opened 19 years ago Closed 19 years ago

The defer attribute of the script html tag is not working correctly in Firefox

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 28293

People

(Reporter: temp89108, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6 In the code below, Firefox is not defering the javascript sections until after the rendering portion of the page. Reproducible: Always Steps to Reproduce: 1.Make an .html page from the code listed in additional information. 2.View the page. 3.Observe the output. Actual Results: When you view this page, Firefox will: 1> Display the alertbox for zap 2> Completely ignore the second script because it generates an error 3> Renders the page and displays the <form> text Expected Results: When you view this page, Firefox SHOULD: 1> Renders the page and displays the <form> text 2> Display the alertbox for zap 3> Completely ignore the second script because it generates an error <?xml version='1.0' encoding='iso-8859-1' ?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>Test JS Script Defer</title> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> </head> <body> <script type="text/javascript" defer> alert('zap'); </script> <script type="text/javascript" defer> alert('Text1.value ===> ' + document.getElementById('Text1').value); </script> <form id="Form1"> <input value="Dummy Text1 Value" id="Text1" name="Text1"> </form> </body> </html>
Attached file Source that illustrates the problem. (deleted) —
Source that illustrates the problem.
Expected Results should read ---> Expected Results: When you view this page, Firefox SHOULD: 1> Renders the page and displays the <form> text 2> Display the alertbox for ==> zap 3> Display the alertbox for ==> Text1.value ===> Dummy Text1 Value
According to the HTML 4 spec, you shouldn't rely on DEFER having any particular behavior, but I'm marking this as a dup of bug 28293 anyway because of bug 28293 comment 26. *** This bug has been marked as a duplicate of 28293 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: