Firefox, Javascript and application/xhtml

I noticed a problem when serving the blog as application/xhtml.

I released the Transpose Email plugin which uses a javascript function Transpose_Email().

This function works properly in IE and Opera.

This works perfect in Firefox when the page is served as text/html, but the moment I shift to application/xhtml, I get a javascript error saying function not found.

I have absolutely no idea how to solve this problem so that the function works when the page is served as XHTML.

Any suggestions / solutions?

Following my posting on MozillaZine Forums, I was able to find a solution.
Simply moved the javascript to an external file.

Also realized that when using the comment tags in the inline javascript, the HTML parser was considering it a comment when the page was served as xhtml unlike when served as html.
As a result, the javascript function was thought to be a comment and not a code!

Issue resolved. Happy that my plugin will now work even with stricter web standards 😀

Share this post with your friends!

One comment

Comments are closed.

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.