我试图以编程方式点击jQuery Mobile中的链接,但它不工作。这是页面代码。以编程方式点击jQuery Mobile应用程序中的链接
<section id="welcome" data-role="page">
<div class="content" data-role="content">
<a id="myLink" href="http://www.google.de" target="_blank">The link</a>
<input type="button" id="launcher" value="Launch the link"/>
</div>
</section>
,这里是JavaScript代码correpsonding:
$(document).ready(function()
{
$("#launcher").bind("click",function()
{
console.log("Inside the button click handler");
$("#myLink").click();
});
});
似乎很简单,但我可以,不像是会使其work.Any帮助表示赞赏。