开发者

jQuery Mobile - $.camelCase is not a function

At the moment, I try to play with jQuery Mobile but it won't work... All I do is:

 <!DOCTYPE html>                                                                
<html xmlns="http://www.w3.org/1999/xhtml">                                               
    <head>                                                                                
        <link rel="stylesheet" type="text/css" href="styles.css">
        <link rel="stylesheet" type="text/css" href="jquery.mobile-1.0b1.css">
        <script type="text/javascript" src="jquery-1.4.2.js"></script>
        <script type="text/javascript" src="jquery.mobile-1.0b1.js"></script>
    </head>                                                                               
    <body>                                                                                
        <div data-role="page">

            <div data-role="header">
                <h1>My first jQM Page</h1>
            </div><!-- /header -->

            <div data-role="content">
                <p>This is the Content</p>
            </div><!-- /content -->

            <div data-role="footer">
                <h4>Footer</h4>
            </div><!-- /footer -->

        </div><!-- /page -->
~                           
    </body>                                                                               
</html>      

Firebug always tells me

$.camelCase is not a function [Break On This Error] return $.camelCase( $.mobile.ns + prop );

in jquery.mobile-1.0b1.js (line 1967)

开发者_StackOverflow中文版

Can you help me? What's wrong with my code?


camelCase is a jQuery core function that jQuery Mobile is using. It exists in the latest version of jQuery (1.6.2), but doesn't seem to exist in the old version (1.4.2) that you're using. I'm not sure when it was introduced, but it seems to have been moved into the core relatively recently.

So, upgrade your jQuery library. The jQuery Mobile site doesn't seem to specify a minimum jQuery version, but their examples use 1.6.1, so I'd upgrade to at least that version -- I'd say you'd be best just grabbing the latest and greatest, 1.6.2.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜