jQuery.isXMLDoc() JQ Home  <<  Utilities  <<  jQuery.isXMLDoc()

XML Document detection.

Description

The jQuery.isXMLDoc() jQuery Type utility method, returns a boolean dependant upon the specified DOM node being within / an XML document.

Shorthand version $.isXMLDoc()

Syntax

Signature Description
jQuery.isXMLDoc( node )Return a boolean dependant upon the specified DOM node being within / an XML document.

Parameters

Parameter Description Type
node DOM node that will be checked to see if it's within / an XML document.Element

Return

A Boolean object.

jQuery.isXMLDoc( node ) Example Utilities  <<  Top

Return a boolean dependant upon the specified DOM node being within / an XML document.

In the example below when we press the button we test some DOM nodes.


$(function(){
  $('#btn7').one('click', function(){
    $('#div7').append('Is document in/an XML document? ' +  $.isXMLDoc( document ) + '<br />');
    $('#div7').append('Is div7 in/an XML document? ' +  $.isXMLDoc( 'div7' ) + '<br />');
  });
});

div7. Some initial text.

Press the button below to action the above code:

Related Tutorials

jQuery Intermediate Tutorials - Lesson 10 - jQuery Copy, Data & Type Utilities