2012-08-22 130 views
0

我有一些問題的傢伙。 我必須用.html()jquery函數刪除我的內容。一切工作正常,但我的iphone phonegap應用程序的頁腳上。但是當我直接在我的html代碼中評論或刪除我的內容時,一切正常,我的應用程序的頁腳留在他的位置。請幫幫我。 這裏是我的代碼片段:jquery .html()刪除html內容

<script id="div_mainheader" type="text/html"> 

     <div id="check_place"> 
      <div id="idcheckin" style="width: 210px; position: relative;" align="left" class="mystatus2 clickable" onclick='showPartnersNearYouPopUp();'> 
       <div id="leave" style="top: 81px;"><img src="graphics/picker.png" style="margin-left: 5px; margin-top: 5px; margin-bottom: -1px;"> 

        CHECK A PLACE ... 

       </div> 
      </div> 

      <div id="idbtleave" style="position: absolute; top: 81px; left: 270px;"> 
       <button id="btleave" class="checkout-button" type="button">{{Localize.quit}}</button> 
      </div> 
     </div> 

    </script> 

這是我打電話給抹去我的內容功能:

$('#check_place').html(''); 

我也試過document.getElementById('check_place').innerrHTML = '';但它以.html同樣的事情()

請幫幫我。非常感謝。

回答

2

使用

$('#check_place').empty(); 
+0

你可以閱讀一下:http://api.jquery.com/empty/ –

+0

感謝名單李四史密斯的回答。 我試過$('#check_place')。empty();但結果是一樣的。 :( –