2015-01-10 26 views
-1

我正在製作一個網站,用戶通過拖放元素進行放置。我想知道如何我可以捕獲之後:從動態頁面中提取html源代碼

我需要捕獲代碼HTML從<div id="frame"> 謝謝。

Pd:重要的是我無法刷新頁面,因爲我失去了更改。

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

這個問題似乎是題外話,因爲海報問:「給我codez」和可能應該聘請一個開發商如果這就是他們所需要 –

+0

我很抱歉,但我想用jQuery,PHP大教堂,不能找到解決方案。 – EmanuelAA

回答

0

我使用ZeroClipboard和變更線998

event.clipboardData.setData( 「text/plain的」,的textContent);對於

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>