Gaurang Tandon
Gaurang Tandon

Reputation: 6781

JQuery Accordion not working when code seems alright

My Code:

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <link rel='stylesheet' type='text/css' href='http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css'/>
        <script type='text/javascript' src='http://code.jquery.com/jquery-1.10.2.js'></script>
        <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
        <script>
            $(document).ready(function(){
                $("#menu").accordion();
            });
        </script>
    </head>
    <body>
        <div id="menu">
            <h3>Section 1</h3>
            <div>
                <p>I'm the first section!</p>
            </div>
            <h3>Sectio 2</h3>
            <div>
                <p>Tab 2</p>
            </div>
            <h3>Section 3</h3>
            <div>
                <p>Tab 3</p>
            </div>
        </div>
    </body>
</html>

I have tried several times but the page does not show up as expected in Google Chrome.Please could someone help me.

Upvotes: 1

Views: 164

Answers (1)

Wilq
Wilq

Reputation: 2272

Add http in your link to jQuery UI:

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>

It throwing error because the library is not loading properly.

Upvotes: 1

Related Questions