网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Chrome开发者工具里的一个隐藏技能:chrome://net-internals

During my holiday I was writing a small tool for fun, which extracts my personal posts from  http://www.  for further analysis. I am using AJAX in jQuery to perform a synchronous call to fetch html source code of given url specified by argument requestURL.、

创新互联是专业的魏县网站建设公司,魏县接单;提供成都网站设计、做网站、成都外贸网站建设公司,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行魏县网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

function getPostByAJAX(requestURL){
   var html = $.ajax({
    url: requestURL,
    async: false}).responseText; 
   return html;}

The requestURL I am using is  http:// tie http:// tb/error.html?ErrType=1 ” give me a reminder that this issue might be related to logon state of BAIDU website, since I would like to return my personal information, it makes sense that the url can only return personal data if cookie is available or user credential is specified ( not supported by BAIDU in this case ). In order to verify my assumption, I request the url directly in Chrome and check its request header fields this time, and yes, the cookie field is there:

Chrome开发者工具里的一个隐藏技能:chrome://net-internals

So now the question is, how to send my cookie information together with the AJAX call in JavaScript code? I found  this article from Google. According to the article, I add the following code in my function:

Chrome开发者工具里的一个隐藏技能:chrome://net-internals

And it works now:

Chrome开发者工具里的一个隐藏技能:chrome://net-internals

By the way, via this tool I can also figure out how the jQuery library file jquery1.7.1.js stored in local laptop is loaded by Chrome. Chrome reads this file by chunks with size 32768 ( the file consists of 8 chunks ).

Chrome开发者工具里的一个隐藏技能:chrome://net-internals

The total size 251661 matches exactly with the number I see in windows, perfect isn’t it?

Chrome开发者工具里的一个隐藏技能:chrome://net-internals

Further reading

For more tips I gained during my daily work about Chrome development tools, please refer to this blog  Chrome Development Tool tips used in my daily work.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

Chrome开发者工具里的一个隐藏技能:chrome://net-internals


分享标题:Chrome开发者工具里的一个隐藏技能:chrome://net-internals
标题来源:http://bjjierui.cn/article/piedhs.html

其他资讯