JSON不会在弹出窗口JavaScript上呈现

时间:2015-03-11 00:04:55

标签: javascript jquery html json

我有智能窗口打开的父窗口,然后从父窗口执行带有参数的JSON,从数据库收集数据并在子窗口的表格中显示。下面是GetJson中的代码没有按预期工作并且什么都不返回。任何帮助表示赞赏

Child.SCHTML:

<div id="chartdivd" >
<table id="bugsDetail" style="border: 1px solid #ccc; width: 100%; font-size: 14px; font-family: 'Segoe UI'">
                        <tr class="tableRow">
                            <th class="tableHeader">BugId</th>
                            <th class="tableHeader">BugType </th>
                            <th class="tableHeader">ResolutionTime </th>
                            <th class="tableHeader">BugTitle</th>

                           </tr>
 </table>

</div>
<link rel="stylesheet" href="amCharts/images/style.css" type="text/css">
<div id="SQLLoading" style="text-align: center; font-family: 'Segoe UI'"><img src="loading.gif"></div>
<script type="text/javascript" src="/assets/jquery.selectboxes.min.js"></script>

<script type="text/javascript" >


    $(document).ready(function () {

    var paras = window.opener.parabug;
    alert(paras);
    var Pars1 = "NoData";
    $.getJSON('/common/JSONRequest', {query: "BugsDetail", pars: paras, db: "Deployment_Metrics"}, function (data) {

        if (data.length > 0)
         {
             for (var i = 0; i < 10; i++) 
            {
                $('#bugsDetail').append('<tr class="tableRow"><td class="tableCell"> ' + data[i]['BugID'] + '</td><td class="tableCell">' + data[i]['BugType'] + '</td><td class="tableCell">' + data[i]['ResolutionTime'] + '</td><td class="tableCell">' + data[i]['BugTitle'] + '</td></tr>');
              }

        }
       else 
       {
              $('#bugsDetail').append('<tr class="tableRow"><td class="tableCell"> No data</td><td class="tableCell">No data</td><td class="tableCell">No data</td><td class="tableCell">No data</td></tr>');
        }
    });
    });



    </script>

0 个答案:

没有答案