Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在Android选项卡上显示HTML列表视图 $.ajax({ url:“http://192.168.1.60/json_android/getItemData.php", jsonpCallback:“项”, contentType:“应用程序/json”, 数据类型:“jsonp”, 成功:功能(数据){ 控制台日志(数据); var标记=”; $.each(data.list,function(i,elem){ var$template=$(“”); $template.find(“.ui-block-a”).append(“”); $template.find(“.ui-block-b”).append(“”) markup+=$template.html(); }); $(“#tweet list”).append(markup).listview(“刷新”,true); //转换到Twitter结果页面。 //$.mobile.changePage($(“#twitterPage”); }, 错误:函数(请求、错误){ 警报(错误); } }); $(“#tweet list”)。在('click','a',函数(事件){ event.preventDefault(); console.log($(this).closest('div').next('.ui-block-b').find('input').val()); });_Android_Jquery_Jquery Mobile - Fatal编程技术网

无法在Android选项卡上显示HTML列表视图 $.ajax({ url:“http://192.168.1.60/json_android/getItemData.php", jsonpCallback:“项”, contentType:“应用程序/json”, 数据类型:“jsonp”, 成功:功能(数据){ 控制台日志(数据); var标记=”; $.each(data.list,function(i,elem){ var$template=$(“”); $template.find(“.ui-block-a”).append(“”); $template.find(“.ui-block-b”).append(“”) markup+=$template.html(); }); $(“#tweet list”).append(markup).listview(“刷新”,true); //转换到Twitter结果页面。 //$.mobile.changePage($(“#twitterPage”); }, 错误:函数(请求、错误){ 警报(错误); } }); $(“#tweet list”)。在('click','a',函数(事件){ event.preventDefault(); console.log($(this).closest('div').next('.ui-block-b').find('input').val()); });

无法在Android选项卡上显示HTML列表视图 $.ajax({ url:“http://192.168.1.60/json_android/getItemData.php", jsonpCallback:“项”, contentType:“应用程序/json”, 数据类型:“jsonp”, 成功:功能(数据){ 控制台日志(数据); var标记=”; $.each(data.list,function(i,elem){ var$template=$(“”); $template.find(“.ui-block-a”).append(“”); $template.find(“.ui-block-b”).append(“”) markup+=$template.html(); }); $(“#tweet list”).append(markup).listview(“刷新”,true); //转换到Twitter结果页面。 //$.mobile.changePage($(“#twitterPage”); }, 错误:函数(请求、错误){ 警报(错误); } }); $(“#tweet list”)。在('click','a',函数(事件){ event.preventDefault(); console.log($(this).closest('div').next('.ui-block-b').find('input').val()); });,android,jquery,jquery-mobile,Android,Jquery,Jquery Mobile,我尝试使用上面的代码用数据填充列表视图。多亏了stackoverflow,它才起作用,但当我在Android平板电脑上试用时,它就不起作用了。它只显示列表视图的搜索栏。尝试在$(文档)中添加脚本 $(文档).on('pageshow',function(){ $.ajax({ url:“http://192.168.1.60/json_android/getItemData.php", jsonpCallback:“项”, contentType:“应用程序/json”, 数据类型:“json

我尝试使用上面的代码用数据填充列表视图。多亏了stackoverflow,它才起作用,但当我在Android平板电脑上试用时,它就不起作用了。它只显示列表视图的搜索栏。

尝试在$(文档)中添加脚本


$(文档).on('pageshow',function(){
$.ajax({
url:“http://192.168.1.60/json_android/getItemData.php",
jsonpCallback:“项”,
contentType:“应用程序/json”,
数据类型:“jsonp”,
成功:功能(数据){
控制台日志(数据);
var标记=”;
$.each(data.list,function(i,elem){
var$template=$(“
  • ”); $template.find(“.ui-block-a”).append(“”); $template.find(“.ui-block-b”).append(“”) markup+=$template.html(); }); $(“#tweet list”).append(markup).listview(“刷新”,true); //转换到Twitter结果页面。 //$.mobile.changePage($(“#twitterPage”); }, 错误:函数(请求、错误){ 警报(错误); } }); $(“#tweet list”)。在('click','a',函数(事件){ event.preventDefault(); console.log($(this).closest('div').next('.ui-block-b').find('input').val()); }); });
    <!DOCTYPE html>
    <head>
        <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
    
    
    </head>
    <body>
        <div data-role="page" id="twitterPage" data-theme="a">
    
            <div data-role="content">
                <ul id="tweet-list" data-role="listview" data-inset="true" data-filter="true" >
    
                </ul>
            </div>
        </div>
    
        <script type="text/javascript">
            $.ajax({
                url: "http://192.168.1.60/json_android/getItemData.php",
                jsonpCallback: 'item',
                contentType: "application/json",
                dataType: 'jsonp',
                success: function(data) {
                    console.log(data);
    
                    var markup = "";
                    $.each(data.list, function(i, elem) {
                        var $template = $('<li>    <div class=ui-grid-a>   <div class=ui-block-a>  </div>  <div class=ui-block-b>    </div>  </div>   </li>');
    
                        $template.find(".ui-block-a").append('<a href=#  id=' + elem['itemId'] + '>' + elem['itemId'] + '</a>');
                        $template.find(".ui-block-b").append("<input type=text />")
    
    
                        markup += $template.html();
    
                    });
                    $("#tweet-list").append(markup).listview("refresh", true);
    
                    // Transition to the Twitter results page.
                    //$.mobile.changePage($("#twitterPage"));
                },
                error: function(request, error) {
                    alert(error);
    
                }
            });
    
    
    
            $('#tweet-list').on('click', 'a', function(event) {
                event.preventDefault();
                console.log($(this).closest('div').next('.ui-block-b').find('input').val());
            });
    
       </script>
    </body>
    
     <!DOCTYPE html>
     <head>
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
     </head>
    <body>
    <div data-role="page" id="twitterPage" data-theme="a">
      <script type="text/javascript">
      $(document).on('pageshow',function(){
        $.ajax({
            url: "http://192.168.1.60/json_android/getItemData.php",
            jsonpCallback: 'item',
            contentType: "application/json",
            dataType: 'jsonp',
            success: function(data) {
                console.log(data);
    
                var markup = "";
                $.each(data.list, function(i, elem) {
                    var $template = $('<li>    <div class=ui-grid-a>   <div class=ui-block-a>  </div>  <div class=ui-block-b>    </div>  </div>   </li>');
    
                    $template.find(".ui-block-a").append('<a href=#  id=' + elem['itemId'] + '>' + elem['itemId'] + '</a>');
                    $template.find(".ui-block-b").append("<input type=text />")
    
    
                    markup += $template.html();
    
                });
                $("#tweet-list").append(markup).listview("refresh", true);
    
                // Transition to the Twitter results page.
                //$.mobile.changePage($("#twitterPage"));
            },
            error: function(request, error) {
                alert(error);
    
            }
        });
    
    
    
        $('#tweet-list').on('click', 'a', function(event) {
            event.preventDefault();
            console.log($(this).closest('div').next('.ui-block-b').find('input').val());
        });
    });
      </script>
        <div data-role="content">
            <ul id="tweet-list" data-role="listview" data-inset="true" data-filter="true" >
    
            </ul>
        </div>
    </div>
    
    
    </body>