English 中文(简体)
• 如何从javascript处开车,开车。
原标题:How to open a jQuery Mobile Dialog from javascript?

我有一页方言,正试图开张,展示美国宇宙航空研究开发机构的成果。

Here is my jQuery success event:

success: function(resp) {                               
  $("#dialog").dialog();
  $("#text").html( SPAM and EGGS! )
}       

我的超文本有两页,第二页是方言 html:

<div data-role="page" id="main">
  # content 
</div>
<div data-role="page" id="dialog">
  <div data-role="header">
    <h1>Your Message</h1>
  </div>    
  <div data-role="content" id="text">
  </div>    
</div>

我的日本宇宙航空研究开发机构(POST)正在工作,并且正在与“SPAM和EGGS”一起更新内容,但诊断书并未铺设。

最佳回答

Add <a> tag anywhere in your page, just put your dialog s id as href as shown below: <a id= lnkDialog href="#dialog" data-rel="dialog" data-transition="pop" style= display:none; ></a>

And replace $("#dialog").dialog(); inside your success event with $("#lnkDialog").click();

问题回答

我认为,这更令人费解:

$.mobile.changePage( #dialog ,  pop , true, true);

页: 1

<div data-role="dialog" id="dialog">...</div>

这一答复还有助于:

    $.mobile.changePage( #myPage , {transition:  pop , role:  dialog });   

如果使用“方言”或“群众”来尝试:

$("#dialog").popup( open );

最新查询版本正确无误

$.mobile.changePage("#dialog", { transition: "pop",role: "dialog" })

As of JQM 1.4 the changePage has been deprecated, and will be removed in 1.5 (http://api.jquerymobile.com/jQuery.mobile.changePage/)

它们建议使用<代码>change()方法代替pagecontainer

$.mobile.pageContainer.pagecontainer("change", "#dialog", { transition:  pop , role: "dialog" });




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签