Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery UI - Cannot read property 'ui' of undefined
    primarykey
    data
    text
    <p>I need to get a script working, which could be used on every possible Website in the world. First of all I need a current version of jQuery. If no jQuery or an old version is running the script will first add jQuery. The second step is to add jQuery UI.</p> <p>The problem is: If a current version of jQuery is running, everything works fine. Otherwise I always get the error:</p> <blockquote> <p>Uncaught TypeError: Cannot read property 'ui' of undefined</p> </blockquote> <p>Anyone can help me? My JS-Code:</p> <pre><code>var $tx; //Check if a current version of jQuery is runnig. if (window.jQuery) { $tx = jQuery; if( jQuery().jquery.replace(".", "") &lt; 17.1 ) { addjQuery(); } else { addNoConflict(); } } else { addjQuery(); } // Get jQuery Version function addjQuery() { loadScript("https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", function(){ $tx = jQuery.noConflict(true); addNoConflict(); }); } // Add Script which requiers jQuery and jQuery UI function addNoConflict() { loadScript("https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js", function(){ var script = document.createElement("script") script.type = "text/javascript"; script.src = "https://www.tariffuxx.de/services/js/txTarifrechnerScript.js"; document.getElementsByTagName("head")[0].appendChild(script); }); } // Load required Scripts function loadScript(url, callback){ var script = document.createElement("script") script.type = "text/javascript"; if (script.readyState){ //IE script.onreadystatechange = function(){ if (script.readyState == "loaded" || script.readyState == "complete"){ script.onreadystatechange = null; callback(); } }; } else { //Others script.onload = function(){ callback(); }; } script.src = url; document.getElementsByTagName("head")[0].appendChild(script); } </code></pre> <p>Thank you in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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. 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