0

我有,例如:

    <iframe width="700px" src="/top_list.html"></iframe>

如何从该框架中删除除 table .. 之外的所有内容,或者用户如何仅看到该页面中的表格内容?


通过首先安装 CUDA 4.2,然后在顶部安装 CUDA 5.0(不卸载 CUDA 4.2),我得到了一个工作环境,我可以在其中创建、打开和调试 CUDA 4.x 和 CUDA 5.0 项目。语法高亮也适用于 4.x 和 5.0 项目。

带有 Nsight 菜单的 Visual Studio

4

2 回答 2

0

如果没有唯一标识符并且您无法更改 top_list 页面,您可以使用 jquery .hide() 隐藏您不想显示的所有内容。

于 2013-01-31T18:18:29.137 回答
0

您需要一些 jquery 工具:

我的示例对查询非常明确。没有链接,所以你可以看到发生了什么。我希望它有所帮助。

$(window).on('load', function() // wait for load event, so the iframe is fully loaded in
{
  var $iframe = $('iframe'); // assuming only one?  You need to target the right iframe, perahps with iframe[src="/top_list.html"] if that's your only option

  var $contents = $iframe.contents();
  var $main = $contents.find('.main');
  var $tbl = $main.next(); // now we have the table

  $contents.find('*').hide(); // hide everything
  $tbl.show(); // show table and...

  var $parent = $tbl.parent(); // get/show all parents of the tbl

  while($parent.length)
  {
     $parent.show(); // show parent
     $parent = $parent.parent(); // move up the hierarchy
  }
});
于 2013-01-31T18:19:12.423 回答