差异:在Firebug中查看页面源代码与视图 [英] Differences: View Page Source vs. View in Firebug

查看:107
本文介绍了差异:在Firebug中查看页面源代码与视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我查看页面的页面源代码时(例如: http ://my.sa.ucsb.edu/public/curriculum/coursesearch.aspx )里面没有太多的代码/信息。例如,在该链接页面上,没有任何类信息显示在页面源代码中。



但是:当我在萤火虫中查看它时,我可以看到更多的html信息。例如,我可以在表格中看到所有的班级信息。



这是为什么?我如何访问完整的(firebug html)?我可以在php / javascript中做到这一点吗?

解决方案

>


  1. PHP生成HTML

  2. 浏览器载入HTML

  3. HTML

这是为什么?

查看源浏览器功能通常显示浏览器收到的纯HTML。其他高级工具如Firefug能够在被JavaScript更改后显示当前的HTML。 (Firefox本身也具有此功能:只需右键单击一些生成的HTML并选择查看选定的源代码即可。)



如何访问完整firebug html)?



我不确定HTML选项卡,但Network选项卡总是显示从服务器收到的文档。 b
$ b

我可以在php / javascript中执行吗?

当原始HTML到达浏览器。



JavaScript可以使用任何DOM节点的 .innerHTML 属性显示HTML。


When I view the page source of a page (like this for example: http://my.sa.ucsb.edu/public/curriculum/coursesearch.aspx) there's not very much code/info in it. On that linked page, for instance, none of the class info is shown in the page source.

BUT: when I view it in firebug, I can see a lot more of the html information. For instance, I can see all of the class info, in tables.

Why is this? How can I access the full (firebug html)? Can I do it in php/javascript?

解决方案

This is the order in which stuff happens:

  1. PHP generates HTML
  2. Browser loads HTML
  3. JavaScript manipulate loaded HTML

Why is this?

The view source browser feature normally shows the plain HTML as received by the browser. Other advanced tools like Firefug are able to display the current HTML after being changed by JavaScript. (Firefox itself has this feature as well: just right click on some generated HTML and choose "View selected source".)

How can I access the full (firebug html)?

I'm not sure about the HTML tab but the Network tab always displays documents as received from the server.

Can I do it in php/javascript?

PHP is no longer running when the original HTML reaches the browser.

JavaScript can display HTML with the .innerHTML property of any DOM node.

这篇关于差异:在Firebug中查看页面源代码与视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆