title: jQuery Mobile - How to Check if the Browser supports jQuery Mobile events
body: <p>I am currently using the jQuery Mobile "pagebeforecreate" page initialization event to load content into my html page. The jQuery Mobile events are discussed here: <a href="http://jquerymobile.com/demos/1.0a2/#docs/api/events.html" rel="nofollow">http://jquerymobile.com/demos/1.0a2/#docs/api/events.html</a>. After the content is loaded synchronously and appended to the body jQuery Mobile formats the page.</p>
  
  <p>Here is my code which works in browsers that support jQuery Mobile:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;jQuery Mobile Test&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /&gt;
      &lt;script src="http://code.jquery.com/jquery-1.4.4.min.js"&gt;&lt;/script&gt;
  
      &lt;script&gt;
      $('body').live('pagebeforecreate',function(event){
  
          var ajaxContent = "";
  
          $.ajax({
              async: false,
              type: "GET",
              url: "test.xml",
              dataType: "xml",
              success: function(xml) { 
  
                  $(xml).find('item').each(function()
                  {
                      ajaxContent += '&lt;li&gt;&lt;a href="'+$(this).find('link').text()+'"&gt;'+$(this).find('title').text()+'&lt;/a&gt;&lt;/li&gt;';
                  });
                  //alert(ajaxContent);
                  $('#menu').append(ajaxContent);
              }
          });
      });
      &lt;/script&gt;
  
      &lt;script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;noscript&gt;You must have JavaScript enabled to view the content on this website.&lt;/noscript&gt;
  &lt;div data-role="page"&gt;
  
      &lt;div data-role="header"&gt;
          &lt;h1&gt;jQuery Mobile&lt;/h1&gt;
      &lt;/div&gt;
  
      &lt;div data-role="content"&gt;
  
          &lt;ul data-role="listview" id="menu"&gt;
  
              &lt;li&gt;&lt;a href="#"&gt;Static&lt;/a&gt;&lt;/li&gt;
  
          &lt;/ul&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and here is the XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;menu&gt;
  &lt;item&gt;
  &lt;title&gt;Awesome Link from XML 1&lt;/title&gt;
  &lt;link&gt;http://www.google.com&lt;/link&gt;
  &lt;/item&gt;
  &lt;item&gt;
  &lt;title&gt;Awesome Link from XML 2&lt;/title&gt;
  &lt;link&gt;http://www.gmail.com&lt;/link&gt;
  &lt;/item&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>How can I detect if the browser supports the "pagebeforecreate" jQuery Mobile event? Or is there a way to detect if this event was executed? If this event is never executed I need to load the XML with another function. Even though IE 8 does not support jQuery Mobile I would still like it to process the XML file and display the links.</p>