admin管理员组

文章数量:1405346

I downloaded jQuery UI 1.10.3. And it es with an older version of jQuery which is 1.9.1. And I have a later version of jQuery: 1.10.2. But jQuery UI seems does not like to work with 1.10.2... Is there anyway to make it works? Or I should just live with it..

<script src="js/jquery-1.9.1.js"></script>
<!--
<script src="jquery-1.10.2.min.js">
-->
<script src="js/jquery-ui-1.10.3.custom.js"></script>
</script>
<script src = song_Selector.js>
</script>
<script>
    $(function() {

        $( "#progressbar" ).progressbar({
            value: 50
        });
    });

</script>


<body>

    <p id="demo">Click the button to do something.</p>
    <button onclick="draw_Progress_Bar ()">Try it</button>

    <h2 class="demoHeaders">Progress Bar</h2>
    <div id="progressbar"></div>

</body>

Codes are above, without the <html> tag.

I downloaded jQuery UI 1.10.3. And it es with an older version of jQuery which is 1.9.1. And I have a later version of jQuery: 1.10.2. But jQuery UI seems does not like to work with 1.10.2... Is there anyway to make it works? Or I should just live with it..

<script src="js/jquery-1.9.1.js"></script>
<!--
<script src="jquery-1.10.2.min.js">
-->
<script src="js/jquery-ui-1.10.3.custom.js"></script>
</script>
<script src = song_Selector.js>
</script>
<script>
    $(function() {

        $( "#progressbar" ).progressbar({
            value: 50
        });
    });

</script>


<body>

    <p id="demo">Click the button to do something.</p>
    <button onclick="draw_Progress_Bar ()">Try it</button>

    <h2 class="demoHeaders">Progress Bar</h2>
    <div id="progressbar"></div>

</body>

Codes are above, without the <html> tag.

Share edited May 18, 2014 at 14:12 Qantas 94 Heavy 16k31 gold badges72 silver badges88 bronze badges asked Jul 5, 2013 at 14:20 87492368749236 4747 silver badges13 bronze badges 6
  • 3 It should work...I noticed your other scripts are in your js directory, and your 1.10.2 script was not, is this correct? – tymeJV Commented Jul 5, 2013 at 14:24
  • @tymeJV yes it is correct that they are not in same folder... thats the problem? (Trying..) Didn't work.. – 8749236 Commented Jul 5, 2013 at 14:44
  • What about the console, do you see any errors? – tymeJV Commented Jul 5, 2013 at 14:46
  • Actually I haven't know there is a console window when I was trying to mix together >_<b.. sry.. (i know it now.. I just stepped into this hole yesterday..) – 8749236 Commented Jul 5, 2013 at 19:33
  • It's your best friend. On Chrome, just hit F12 and select "Console" from the tabs. – tymeJV Commented Jul 5, 2013 at 19:41
 |  Show 1 more ment

2 Answers 2

Reset to default 4

When you are loading the script, you've forgotten the end tags, and you've also forgotten your <head> tags if this is the whole document:

<!-- <script src="js/jquery-1.9.1.js"></script> -->
<script src="jquery-1.10.2.min.js"></script>
<script src="js/jquery-ui-1.10.3.custom.js"></script>
<script src = song_Selector.js></script>
<script>
    $(function() {
        $( "#progressbar" ).progressbar({
            value: 50
        });
    });
</script>

<body>
    <p id="demo">Click the button to do something.</p>
    <button onclick="draw_Progress_Bar ()">Try it</button>

    <h2 class="demoHeaders">Progress Bar</h2>
    <div id="progressbar"></div>
</body>

What happened was actually the following when you unmented jQuery 1.10.2:

<script src="jquery-1.10.2.min.js">
    <script src="js/jquery-ui-1.10.3.custom.js"></script>
</script>

As any text inside a <script> tag is ignored with an src attribute set and will not be parsed, this will not be loaded.

Before, it would have worked fine as it would have simply been the following:

<script src="js/jquery-ui-1.10.3.custom.js">
    </script>
</script>

... with the text inside the tag being ignored, as there is a src attribute (with this having no effect).

you can this by function load script

    function loadscript(url){
var doc = document.getelementbytagname("head");
var script = document.createlement("script") ; 
script.url = script
}

本文标签: javascriptjQuery 1102 and jQuery UI 1103Stack Overflow