0

jQuery 1.5.2を使用すると、なぜこのフィドルが機能するのですか?

http://jsfiddle.net/azZVk/17/

ここに画像の説明を入力してください

jQuery 1.7.2に設定すると、何も表示されません

ここに画像の説明を入力してください

jQuery Mobile 1.0.1が選択されていない場合、ここに表示されます:

ここに画像の説明を入力してください

これを表示する必要があります:

ここに画像の説明を入力してください

フィドルコード:

<div data-role="page" id="firstpage">

        <div data-role="header">
                <h1>First Page</h1>
        </div>

<div data-role="content" id="links">

</div>

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

</div>

<div data-role="page" id="secondpage">

        <div data-role="header">
                <a href='#' class='ui-btn-left' data-icon='arrow-l' onclick="history.back(); $('#pagecontent').empty(); return false">Back</a><h1>Bar</h1>
        </div>

        <div id="pagecontent" data-role="content">

        </div>

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

$(document).ready(function() {

for (var i = 0; i < 4; i++) {  
    $('#links').append(buildButton());     
}

   function buildButton() {
    var button= '<a data-role="button" href="#secondpage" data-theme="c" class="ui-btn ui-btn-corner-all ui-shadow ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">Link Button</span></span></a>';

    return $(button).click(function () {
        $("#secondpage").data("val", "test value")
    });       
   }

    $('#secondpage').live('pageshow', function() {
        var val1= $(this).data('val');
        $("#pagecontent").html(val1);
        console.log('val is '+ val1);
    });

});
4

1 に答える 1

1

問題は、選択したときです1.7.2

あなたもチェックしましたMobile 1.0.1

編集:ここで間違ったバージョンを使用しています

あなたのリソースで

1.7.2で動作するように、それらを最新バージョンに更新します

CSShttp ://code.jquery.com/mobile/1.1.0jquery.mobile-1.1.0.css

JShttp ://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js

ここで作業するには:http 1.7.2//jsfiddle.net/azZVk/25/

また、代わりにlive私たちを使用しないでください。on

于 2012-07-19T17:05:36.737 に答える