New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline JavaScript breaks XHTML strict validation #125

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 4 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

What steps will reproduce the problem?
1. Write a small script and place it in an external .js file
2. View the source of the page and see the small script placed in the head 
section of the page instead of in the external .js file
3. Validate the page with an XHTML strict doctype and view errors

What version of the product are you using (please check X-Mod-Pagespeed
header)?
0.9.10.1-250

On what operating system?
CentOS 5.5

Which version of Apache?
2.2.3

Which MPM?
prefork

Please provide any additional information below, especially a URL or an
HTML file that exhibits the problem.
This is happening on a site I am currently developing for a client. I recently 
put the site up yesterday "as is" so the client could see it. I went to do some 
validation checking today and noticed this problem. Here's the URL: 
http://wemakeitrun.com/accounting2web/
Originally, I had all the javascript that's now in the head section in an 
external file called main.js.
I assume it's breaking validation because it doesn't have the proper <!-- // 
--> or the CDATA tag around it...

Original issue reported on code.google.com by aaronjwood on 2 Dec 2010 at 4:29

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Your right. It appears that strict XHTML does not allow inline scripts unless 
they are (A) escaped or (B) surrounded by CDATA[[ ]].

Matthew, could you look into this. We could either turn off inlining JS for 
XHTML or just add the //CDATA tags as suggested here: 
http://lachy.id.au/log/2006/11/xhtml-script .

Original comment by sligocki@google.com on 3 Dec 2010 at 10:45

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Thanks for the report.  I have a fix for this in the works now; it should make 
its way into trunk in the near future.

Original comment by mdste...@google.com on 7 Dec 2010 at 8:53

  • Changed state: Started
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

You're welcome :) Glad to be of help.

Original comment by aaronjwood on 7 Dec 2010 at 8:58

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Fixed back in r298

Original comment by sligocki@google.com on 31 Dec 2010 at 12:34

  • Changed state: Fixed
  • Added labels: release-note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment