html 中未显示绑定列表 查看 knockout.js 中的源代码?

Binded list is not showing in html view source in knockout.js?

我正在使用 knockout js 在我的 table 中绑定 link 的列表,这是代码

  <table class="table table-bordered">
            <thead>
                <tr>
                    <th style="width:10%;">#</th>
                    <th style="width:50%;">Link</th>
                    <th style="width:20%;">Active</th>
                    <th style="width:20%;">Action</th>
                </tr>
            </thead>
            **<tbody data-bind="foreach:LinkList">**
                <tr>
                    <td data-bind="text:$index()+1"></td>
                    <td><span data-bind="text:$data.LinkName.length <= 40 ? $data.LinkName : $data.LinkName.substring(0, 40) + '...'"></span></td>
                    <td>
                        <input type="checkbox"  data-bind="checked:$data.IsActive" disabled />
                    </td>
                    <td>
                        <button class="btn btn-xs btn-primary" type="button" title="Edit"
                                data-bind="click:$parent.OnClickEditBtn">
                            <span class="glyphicon glyphicon-edit"></span>
                        </button>
                        <button class="btn btn-xs btn-danger" type="button" title="Delete"
                                data-bind="click:$parent.OnClickDeleteBtn">
                            <span class="glyphicon glyphicon-trash"></span>
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>

这里我用foreach绑定了link个列表显示在HTML页面 我也附上那个页面的 link http://growingtab.com/links

但是当您检查页面源代码中的 html 页面时,link 没有显示在其源代码中? 那么我怎样才能在页面源代码中显示那些 link 呢? 有什么办法可以显示吗?

显示的源代码是请求页面时服务器 return 为客户端提供的任何内容——您实际上是在进行 DOM 不会修改原始源代码的操作。您可以做的是使用像 Firebug 这样的开发人员工具检查 DOM 的当前状态,或者将逻辑移动到服务器端,这将 return 生成 HTML。

jQuery DOM changes not appearing in view source

createElement() not showing up in view source