Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.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
Javascript 如何查看用于显示隐藏json数据的html代码?_Javascript_Html_Css_Json_Youtube - Fatal编程技术网

Javascript 如何查看用于显示隐藏json数据的html代码?

Javascript 如何查看用于显示隐藏json数据的html代码?,javascript,html,css,json,youtube,Javascript,Html,Css,Json,Youtube,我试图查看一些使用JSON编码的隐藏数据的源代码,然后显示在网页中。如果我是正确的,javascript将处理数据,然后使用html+css在浏览器中显示数据。我对数据不感兴趣,但对javascript用于显示编码的JSON数据的html和css感兴趣。我试了几个小时还是找不到 我正在试验的网站是YouTube,那里的数据是评论。我找不到YouTube用来显示评论的CSS和HTML。你可以在YouTube上的任何视频上进行测试。我尝试的是: 1) 查看源代码。我得到的只是从id=“comment

我试图查看一些使用JSON编码的隐藏数据的源代码,然后显示在网页中。如果我是正确的,javascript将处理数据,然后使用html+css在浏览器中显示数据。我对数据不感兴趣,但对javascript用于显示编码的JSON数据的html和css感兴趣。我试了几个小时还是找不到

我正在试验的网站是YouTube,那里的数据是评论。我找不到YouTube用来显示评论的CSS和HTML。你可以在YouTube上的任何视频上进行测试。我尝试的是:

1) 查看源代码。我得到的只是从id=“comments test iframe”的div调用注释。YouTube网站上显示的代码

<div class="comments-iframe-container">
    <div id="comments-test-iframe"></div>
    <div id="distiller-spinner" class="action-panel-loading">
        <p class="yt-spinner">
      <img src="https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" class="yt-spinner-img" alt="Loading icon">

    <span class="yt-spinner-message">
Loading...
    </span>
  </p>

    </div>
  </div>
  </div>

加载。。。

2) 文件将页面另存为>网页,在Firefox和Chrome中完成。评论仍将从YouTube检索。所以我无法看到YouTube用来显示评论的css和html

3) 我试图安装。我可以看到是用来显示评论的容器。同样,我看不到用于显示注释的html+css。我得到的只是:

<div id="comments-test-iframe" style="text-indent: 0px; margin: 0px; padding: 0px; background: none  repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline; display: inline-block; width: 591px; height: 5375px;">

YouTube用来显示评论的div元素或容器。但是没有评论

4) 我试着使用[HTMLClipper](),这是一个书签小程序,它允许你将任何网页的Html部分和附加的css样式一起复制,但它也不起作用


我怎样才能看到css+html?是否有一个简单的方法来保存浏览器显示的内容,避免Firebug和检查?我很好奇谷歌在这里使用的技巧是什么?

如果我正确理解了你的问题。。。这种方法我很幸运,尽管它可能不是你想要的


我使用Firefox/Aurora。我用输出的HTML突出显示整个部分,然后右键单击并选择“查看选择源”。这样我就可以看到在我只进行常规查看源代码时未显示的HTML。

YouTube生成的代码就是这样

  <div class="comments-iframe-container">
    <div style="text-indent: 0px; margin: 0px; padding: 0px; background: none repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline; display: inline-block; width: 591px; height: 4799px;" id="comments-test-iframe"><iframe title="Comment on this" data-gapiattached="true" src="https://plus.googleapis.com/u/0/_/widget/render/comments?usegapi=1&amp;first_party_property=YOUTUBE&amp;href=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOWsyrnOBsJs&amp;owner_id=o5--boVIi-ow0xAU3VyxMg&amp;query=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOWsyrnOBsJs&amp;stream_id=UCo5--boVIi-ow0xAU3VyxMg&amp;substream_id=OWsyrnOBsJs&amp;view_type=FILTERED&amp;width=590&amp;youtube_video_acl=PUBLIC&amp;hl=en_GB&amp;origin=https%3A%2F%2Fwww.youtube.com&amp;search=%3Fv%3DOWsyrnOBsJs&amp;hash=&amp;gsrc=1p&amp;jsh=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.gapi.en.TY07tiUU0tE.O%2Fm%3D__features__%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTNfGmB_-do3YO3g20AHt3L6itPzpQ#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Confirsttimeplusonepromo%2Conthumbsup%2Contimestampclicked%2Conready%2Conupgradeaccount%2Conallcommentsclicked&amp;id=I0_1403359704352&amp;parent=https%3A%2F%2Fwww.youtube.com&amp;pfname=&amp;rpctoken=50836660" name="I0_1403359704352" id="I0_1403359704352" vspace="0" tabindex="0" style="position: static; top: 0px; width: 590px; margin: 0px; border-style: none; left: 0px; visibility: visible; height: 4799px;" scrolling="no" marginwidth="0" marginheight="0" hspace="0" frameborder="0" width="100%"></iframe></div>
    <div style="display: none;" id="distiller-spinner" class="action-panel-loading hid">
        <p class="yt-spinner">
      <img src="https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" class="yt-spinner-img" alt="Loading icon">

    <span class="yt-spinner-message">
Loading...
    </span>
  </p>

    </div>
  </div>

加载。。。

注释以iframe显示,并承载在上。这已经设置了安全设置,因此您无法通过访问该URL直接访问这些设置。不过,Firebug应该允许您在YouTube页面中检查它们。我不知道为什么你做那件事会有困难

我在这里复制了iframe的代码:-firebug可能也是您的朋友,因为原始代码非常混乱