Title: JavaScript, Firefox and application/xhtml
Last modified: August 18, 2016

---

# JavaScript, Firefox and application/xhtml

 *  Resolved [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/javascript-firefox-and-applicationxhtml/)
 * I noticed a problem when serving the blog as application/xhtml.
 * I released the [Transpose Email plugin](http://www.ajaydsouza.com/wordpress/plugins/transpose-email-plugin/)
   which uses a javascript function `Transpose_Email()`.
    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?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [yngwin](https://wordpress.org/support/users/yngwin/)
 * (@yngwin)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/javascript-firefox-and-applicationxhtml/#post-221286)
 * You should keep the JavaScript as an external script and just link to it from
   the XHTML document. You can’t have ‘inline’ JavaScript like that in an XML document(
   as a real XHTML document is). The only option is to escape it properly (read 
   up on CDATA), but keeping scripts and CSS external is the best.
 *  Thread Starter [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/javascript-firefox-and-applicationxhtml/#post-221433)
 * Thanks for the post.
    Was able to fix the problem when I got the same feedback
   from [MozillaZine Forum](http://forums.mozillazine.org/viewtopic.php?t=280593).
 * Moved the js to an external file.
 * Released v1.1 of the plugin 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘JavaScript, Firefox and application/xhtml’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [xhtml](https://wordpress.org/support/topic-tag/xhtml/)
 * [xml](https://wordpress.org/support/topic-tag/xml/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [20 years, 12 months ago](https://wordpress.org/support/topic/javascript-firefox-and-applicationxhtml/#post-221433)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
