Javascript 将两个不同的html页面内容复制到一个页面中

Javascript 将两个不同的html页面内容复制到一个页面中,javascript,jquery,html,Javascript,Jquery,Html,我有两个不同的静态html页面(a.html和b.html),我想将这两个html页面的内容复制到c.html页面。我经历了这一切。任何解决方案,我怎么能复制两个html页面的内容到一个页面 任何JQuery或JavaScript逻辑???都可以使用JQuery。例如: $( "#a" ).load( "article.html" ); $( "#b" ).load( "article2.html" ); 如果不希望分割内容,请使用append()函数。类似的东西…您可以使用jquery。例如

我有两个不同的静态html页面(
a.html
b.html
),我想将这两个html页面的内容复制到c.html页面。我经历了这一切。任何解决方案,我怎么能复制两个html页面的内容到一个页面


任何JQueryJavaScript逻辑???

都可以使用JQuery。例如:

$( "#a" ).load( "article.html" );
$( "#b" ).load( "article2.html" );

如果不希望分割内容,请使用append()函数。类似的东西…

您可以使用jquery。例如:

$( "#a" ).load( "article.html" );
$( "#b" ).load( "article2.html" );

如果不希望分割内容,请使用append()函数。类似的东西…

您可以使用jquery。例如:

$( "#a" ).load( "article.html" );
$( "#b" ).load( "article2.html" );

如果不希望分割内容,请使用append()函数。类似的东西…

您可以使用jquery。例如:

$( "#a" ).load( "article.html" );
$( "#b" ).load( "article2.html" );

如果不希望分割内容,请使用append()函数。类似的东西…

在c.html上有一个div容器。您希望每个html内容都有一个容器,以便可以指定要追加的html的位置

<div id="container">
    <div id="a">
    </div>
    <div id="b">
    </div>
</div>

当然,通过服务器端实现这一点要容易得多,但如果您想让它成为所有前端,这将起作用。

在您的c.html上有一个div容器。您希望每个html内容都有一个容器,以便可以指定要追加的html的位置

<div id="container">
    <div id="a">
    </div>
    <div id="b">
    </div>
</div>

当然,通过服务器端实现这一点要容易得多,但如果您想让它成为所有前端,这将起作用。

在您的c.html上有一个div容器。您希望每个html内容都有一个容器,以便可以指定要追加的html的位置

<div id="container">
    <div id="a">
    </div>
    <div id="b">
    </div>
</div>

当然,通过服务器端实现这一点要容易得多,但如果您想让它成为所有前端,这将起作用。

在您的c.html上有一个div容器。您希望每个html内容都有一个容器,以便可以指定要追加的html的位置

<div id="container">
    <div id="a">
    </div>
    <div id="b">
    </div>
</div>

当然,通过服务器端实现这一点要容易得多,但如果您想让它成为所有前端,这将起作用。

HTML框架可用于拆分网页,以便您可以将多个HTML文件或网页加载到一个网页中。这将导致web浏览器一次显示多个页面。我喜欢使用的这种技术的一个常见示例是在浏览器窗口的左侧显示文档索引,其中包含说明和链接,因此当读者单击链接时,该页面将显示在浏览器窗口的右侧

<html>
      <head>
        <title>Multiple pages in one page</title>
      <head>
      <frameset border="1" cols="200,*" frameBorder="0" frameSpacing="4">
        <noframes>
          <body>
            <p>
             You should include HTML here to support webcrawlers and browsers that don't support frames.  
             You may want to include a second copy of your index, and set your wallpaper and colors
            in the BODY statement above the same as you would in your index file.
           </p>
         </body>
        </noframes>
        <frame name="left" src="htmlindex.html">
        <frame name="right" src="htmlintroduction.html">
      </frameset>
  </html>

一页多页

您应该在此处包含HTML以支持WebCrawler和不支持框架的浏览器。
您可能希望包含索引的第二份副本,并设置壁纸和颜色
在上面的BODY语句中,与在索引文件中相同。


HTML框架可用于拆分网页,以便将多个HTML文件或网页加载到一个网页中。这将导致web浏览器一次显示多个页面。我喜欢使用的这种技术的一个常见示例是在浏览器窗口的左侧显示文档索引,其中包含说明和链接,因此当读者单击链接时,该页面将显示在浏览器窗口的右侧

<html>
      <head>
        <title>Multiple pages in one page</title>
      <head>
      <frameset border="1" cols="200,*" frameBorder="0" frameSpacing="4">
        <noframes>
          <body>
            <p>
             You should include HTML here to support webcrawlers and browsers that don't support frames.  
             You may want to include a second copy of your index, and set your wallpaper and colors
            in the BODY statement above the same as you would in your index file.
           </p>
         </body>
        </noframes>
        <frame name="left" src="htmlindex.html">
        <frame name="right" src="htmlintroduction.html">
      </frameset>
  </html>

一页多页

您应该在此处包含HTML以支持WebCrawler和不支持框架的浏览器。
您可能希望包含索引的第二份副本,并设置壁纸和颜色
在上面的BODY语句中,与在索引文件中相同。


HTML框架可用于拆分网页,以便将多个HTML文件或网页加载到一个网页中。这将导致web浏览器一次显示多个页面。我喜欢使用的这种技术的一个常见示例是在浏览器窗口的左侧显示文档索引,其中包含说明和链接,因此当读者单击链接时,该页面将显示在浏览器窗口的右侧

<html>
      <head>
        <title>Multiple pages in one page</title>
      <head>
      <frameset border="1" cols="200,*" frameBorder="0" frameSpacing="4">
        <noframes>
          <body>
            <p>
             You should include HTML here to support webcrawlers and browsers that don't support frames.  
             You may want to include a second copy of your index, and set your wallpaper and colors
            in the BODY statement above the same as you would in your index file.
           </p>
         </body>
        </noframes>
        <frame name="left" src="htmlindex.html">
        <frame name="right" src="htmlintroduction.html">
      </frameset>
  </html>

一页多页

您应该在此处包含HTML以支持WebCrawler和不支持框架的浏览器。
您可能希望包含索引的第二份副本,并设置壁纸和颜色
在上面的BODY语句中,与在索引文件中相同。


HTML框架可用于拆分网页,以便将多个HTML文件或网页加载到一个网页中。这将导致web浏览器一次显示多个页面。我喜欢使用的这种技术的一个常见示例是在浏览器窗口的左侧显示文档索引,其中包含说明和链接,因此当读者单击链接时,该页面将显示在浏览器窗口的右侧

<html>
      <head>
        <title>Multiple pages in one page</title>
      <head>
      <frameset border="1" cols="200,*" frameBorder="0" frameSpacing="4">
        <noframes>
          <body>
            <p>
             You should include HTML here to support webcrawlers and browsers that don't support frames.  
             You may want to include a second copy of your index, and set your wallpaper and colors
            in the BODY statement above the same as you would in your index file.
           </p>
         </body>
        </noframes>
        <frame name="left" src="htmlindex.html">
        <frame name="right" src="htmlintroduction.html">
      </frameset>
  </html>

一页多页

您应该在此处包含HTML以支持WebCrawler和不支持框架的浏览器。
您可能希望包含索引的第二份副本,并设置壁纸和颜色
在上面的BODY语句中,与在索引文件中相同。


为什么不在服务器端生成它呢?正如@messerbill所说,服务器端生成是你的朋友。如果您不能这样做,可能会向服务器发出AJAX请求,请求
a.html
b.html
并组合它们,然后将它们附加到
c.html
中的某个容器中?可能会删除模板或组件,为什么不在服务器上生成它们