2013-02-06 58 views
0

我在顯示jquery mobile popup時遇到問題。這是我對彈出的代碼,這是從一個servletjQuery Mobile popup顯示不正確

<a href='#popupBasic_1' data-rel='popup' 
     style='text-decoration: none; background-color: red; display: block; width: 40px; height: 40px; text-align: center; position: absolute; font-size: 13px; font-weight: bold; color: white'>bill</a> 
    <div data-role='popup' id='popupBasic_1'> 
     <div style='height: 200px; width: 300px'> 
      <div 
       style='text-decoration: none; background-color: red; display: block; width: 40px; height: 40px; text-align: center; font-size: 13px; font-weight: bold; color: white'>bill</div> 
      <div 
       style='text-decoration: none; background-color: blue; display: block; width: 40px; height: 40px; text-align: center; font-size: 13px; font-weight: bold; color: white'>bob</div> 
     </div> 
    </div> 

我試圖把它放在HTML

<div id="users"></div> 

這個div標籤內返回這是我的AJAX調用來替換HTML

$.get(url).success(function(result) { 
      //document.getElementById("users").innerHTML = result; 
      $("#users").html("<code>" + result + "</code>"); 

我已經嘗試了上述兩種情況,並在頁面上的彈出窗口中顯示兩個元素。如果我使用這個彈出代碼並將其手動放置在div標籤中,它就可以工作。

任何幫助表示讚賞。

回答

2

試試這個:

$("#users").html(result).trigger("create"); 

jsFiddle

+0

我給在晚上這是一個嘗試。感謝您的回覆,我會隨時通知您。 –

+0

完美地工作,謝謝! –

+0

非常歡迎!快樂的移動編碼。 – peterm