so_isAppXML

Summary

Determines if the document is being served as application/xhtml+xml. Returns boolean.

Arguments:

n/a

Usage:

isAppXML = so_isAppXML();

Examples:

This function is used in the Mouseover DOM Inspector v2.0 to determine if the "edit html" functionality is available, as the innerHTML property is read-only on application/xhtml+xml documents.

Code

function so_isAppXML() {
	if(document.contentType) {
		var cType = document.contentType.indexOf("application/xhtml+xml") > -1;
	} else {
		var cType = false;
	}
	return cType;
}

License

This code is issued under a Creative Commons license. You do not need my permission to use it, though I'm always interested in seeing where my code has ended up if you want to drop me a line.

slayeroffice main