2013-02-06 59 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