Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> &lt;script src="http://code.jquery.com/jquery-1.10.2.min.js"&gt;&lt;/script&gt; &lt;script&gt; $( document ).ready( function() { var Compatibility = function() { var context = this; context.TestObject = function( id ) { function CreateObject( id ) { $('body').prepend('&lt;div id="CompatibilityTestObject_' + id + '"&gt;&lt;/div&gt;'); } // Constructor CreateObject( id ); return { GetObject: function( id ) { try { // Fetch with raw Javascript so if the javascript method does not exist it will throw an error var fetchedDomElement = document.getElementById( "CompatibilityTestObject_" + id ); return fetchedDomElement; } catch( e ) { // Failed to fetch DOM Element return false; } }, DeleteObject: function( id ) { try { $( "#CompatibilityTestObject_" + id ).remove(); return true; } catch( e ) { // Failed to remove object return false; } } } } context.Factory = function() { return { CreateTestObject: function( id ) { var m_TestObject = new context.TestObject( id ); return m_TestObject.GetObject( id ); }, DeleteTestObject: function( id ) { return context.DeleteObject( id ); } } }(); var CSS = function() { return { BackgroundPosition: function() { var testObject = context.Factory.CreateTestObject( "BackgroundPosition" ); try { // My first try at testing for background positioning testObject.style.backgroundPosition = "center"; return true; } catch( e ) { // Implement the handling of this error //alert( "Does not support backgroundPosition: " + e.message ); return false; } } } }(); return { CheckCSS: CSS } }(); } ); &lt;/script&gt; </code></pre> <p>Take a copy of the above script... place it in your code there, then call upon it like so:</p> <pre><code>if( Compatibility.CheckCSS.BackgroundPostion() ) { // Compatible browser } else { // Not compatible } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload