如何使用jQuery提取HTML页面的压缩 [英] how to extract the condense of a html page using jquery

查看:104
本文介绍了如何使用jQuery提取HTML页面的压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要获取页面的innerHtml详细信息.在以下脚本中,当我提醒obj iam获取HTML文本时,我需要获取内部html对象,这是怎么可能的.
请更正以下代码,我需要采用ID = form3
的html形式


i need to get the innerHtml details of a page .in the below script when i alert the obj iam getting the Text of Html i need to get the inner html object how it is possible.
kindly correct the below code i need to take the Form of html with ID=form3

function GetPage() {

           $.ajax({
               url: "Page1.aspx",
               type: "Post",
               async: false,
               data: { "param": "abcd"
               },
               success: function(obj) {




               }
           });




//HTML




//HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<script language=javascript>
    alert('ggg');
</script>
<body id="bd" bgcolor="#ff9999">
    <form id="form3" runat="server">
    
  <div id="dynamic"> </div>
    <asp:TextBox ID="TextBox1" runat="server">
    <asp:Button ID="Button1" runat="server" Text="Button" />
 <div id="mainremoved" style="width:100%">  This is Home content </div>
    </form>
</body>
</html>

推荐答案

.ajax({ 网址:"Page1.aspx", 类型:发布", 异步:错误, 数据:{"param":"abcd" }, 成功:function(obj){ } });
.ajax({ url: "Page1.aspx", type: "Post", async: false, data: { "param": "abcd" }, success: function(obj) { } });




//HTML




//HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<script language=javascript>
    alert('ggg');
</script>
<body id="bd" bgcolor="#ff9999">
    <form id="form3" runat="server">
    
  <div id="dynamic"> </div>
    <asp:TextBox ID="TextBox1" runat="server">
    <asp:Button ID="Button1" runat="server" Text="Button" />
 <div id="mainremoved" style="width:100%">  This is Home content </div>
    </form>
</body>
</html>


看看以下内容:
jQuery HTML操作 [ jQuery HTML()vs InnerHTML()? [
Take a look at the following:
jQuery HTML Manipulation[^]
and
Jquery HTML() vs InnerHTML()?[^]

Those two links should enable you to solve your problem :)

Best regards
Espen Harlinn


您可以在提取页面之前对其进行过滤.
使用下面的代码,让我知道它是否有效.
You can filter it before extracting the page.
Use below code and let me know if it works or not.
function GetPage() {


这篇关于如何使用jQuery提取HTML页面的压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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