Masters, how can I get the content of Sina News comments? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:53
Original
798 people have browsed it

When you open a news webpage, there are comments about the news below.

When you view the source code, you only see the content of the news.

You cannot see the content of the comments. These The comments are all in the box,

Can the master tell me,

What is dynamic loading?

If you want to get it, is there any way?

Thank you very much!


Reply to the discussion (solution)

Obtained by ajax

Master, can you be more detailed? Is there any relevant code? . I'll give you all the points, I still have 98 points.

It’s very simple. For example, the ID of an article is 4. Only the article content is read, and comments can be based on the ID=4 of your article. ajax query and display it.
You can refer to the following: How to make js cross-domain on your own website

    function G(id){if(typeof(id)=="string"){return document.getElementById(id);}return id;}      var id = G("testScript").innerHTML;      //alert(scriptArgs);      function pinlun(id){              $.ajax({              type: "POST",              url: "testAJAX.asp",              data: "id=" + id,              beforeSend: function(){              $("#confirm").text("正在读取中,请稍候...");//#confirm为显示内容的DIV ID              },              success: function(msg){              if(msg !== ""){                  //alert(msg);                  var str=msg;                  $("#confirm").html(msg);//查询出来的内容                          }else {                  $("#confirm").text("暂无记录");              }              }          });       }      login(id);  
Copy after login

login(id); //Change to pinlun(id)

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template