Closed Bug 319214 Opened 19 years ago Closed 19 years ago

Javascript is ignored if application/xhtml+xml is used as Content-Type for XHTML file

Categories

(Core :: XML, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 68193

People

(Reporter: Tolpatsch, Unassigned)

References

()

Details

(Whiteboard: DUPEME)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 If a server tells the browser that the content-type is "application/xhtml+xml", then FireFox as well as Mozilla do not execute Javascript within a PHP webpage. Reproducible: Always Steps to Reproduce: 1. Create a PHP document with the following source code: <?php // Remove the following line and JavaScript will work fine in FireFox, otherwise not header('Content-Type: application/xhtml+xml',true,200); echo '<?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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>JavaScript Testdocument</title> </head> <body><p> <script type="text/javascript" language="javascript"> document.write('Can you see this text?'); </script> </p> </body> </html> 2. When browsed with FireFox, the question "Can you see this text?" is not displayed. 3. Modify the above source code and comment the header-command, resulting in that the server tells the client that the content is not "application/xhtml+xml" but rather "text/html" 4. The question of the JavaScript is displayed. Actual Results: The Javascript was not executed, therefore we have a blank page. Expected Results: We should have the text "Can you see this text?", which would be the result of the JavaScript.
Component: JavaScript Engine → XML
Whiteboard: DUPEME
Assignee: general → xml
QA Contact: general → ashshbhatt
*** This bug has been marked as a duplicate of 68193 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
beat me to it! Thanks Erik.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.