Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Mobile 1.3.2 error when using panel

I'm trying to implement panel functionality with jQuery Mobile 1.3.2. Here's my code:

    <div data-role="page" id="homePage">
    <section data-role="panel" class="row">
        PANEL HERE..
    </section>

    <section data-role="header" class="row">
        <div class="large-12 columns">
            <h3>
                Header..
            </h3>               
        </div>          
    </section>

    <section data-role="content" class="row">
        <div class="large-12 columns">
            CONTENT..               
        </div>          
    </section>

    <section data-role="footer" class="row">
        <div class="large-12 columns">
            FOOTER..                
        </div>          
    </section>

    <script type="text/javascript">
        $(function ()
        {

        }());
    </script>
</div>

When I run this is a browser, I get an error:

$.data(...) is undefined

I've traced it to line 10330 of jquery.mobile-1.3.2.js:

var $theme = $.data( page[0], "mobilePage" ).options.theme,

What am I missing?

like image 223
Tom Schreck Avatar asked Jan 13 '23 09:01

Tom Schreck


1 Answers

I see that jQuery mobile panel is not compatible with jQuery 2.0.

You got the error:

TypeError: 'undefined' is not an object (evaluating 'a.data(d[0],"mobilePage").options')

Try downgrade to jQuery 1.9 it works with it.

Demo: http://jsfiddle.net/IrvinDominin/3wUts/

like image 56
Irvin Dominin Avatar answered Jan 31 '23 07:01

Irvin Dominin