从动态页面中提取 html 源代码


Extract html source code from a dynamic page

我正在制作一个网站,用户可以通过拖放元素来放置。我想知道在那之后如何捕捉:

我需要从<div id="frame">捕获代码HTML 谢谢。

Pd:重要的是我无法刷新页面,因为我丢失了更改。

<html>
  <head>
  </head>
  <body>   
    <div class="section">
      <div class="menu">
      </div>    
      <div id="frame" class="ui-sortable">
      </div>  
    </div>
  </body>
</html>

我使用零剪贴板并更改行 998

event.clipboardData.setData("text/plain", textContent); for

event.clipboardData.setData("text/html", textContent);

<button class="btnCopyToClipboard" data-clipboard-target="frame" data-clipboard-text="Default text">Copiar texto</button>
        <script src="js/ZeroClipboard.js"></script>
        <script>
        $(function (){
            var clip = new ZeroClipboard($(".btnCopyToClipboard"), {
              moviePath: '("/js/ZeroClipboard.swf")' // ruta donde se encuentra el plugin
            });
            clip.on('load', function(client){
           });
           clipboardData.setData("text/html", htmlContent);
           clip.on('complete', function(client, args){
             this.style.display = 'none'; // "this" is the element that was clicked
             alert("Copied text to clipboard: " + args.text );
           });
           clip.on('mouseover', function(client){
           });
           clip.on('mouseout', function(client){
          });
          clip.on('mousedown', function(client){
         });
           clip.on('mouseup', function(client){
           });
       });
   </script>