jquery mobile changePage error
Every time I click the link, I only get "error loading page".
<script>
$('.popup').click(functi开发者_如何学编程on(){
$.mobile.changePage('http://www.google.com', 'slideup');
});
</script>
<a class="popup" href="#">My Popup</a>
I'm fairly sure changePage() method is only for linking between internal jQuery mobile "Pages"
You will most likely be getting an error because jQuery will be looking for a that URL in relation to your own website.
If you want to create an external link to Google, use the following in your anchor tag:
<a class="popup" href="http://www.google.com" rel="external" target="_blank">My Popup</a>
Because it's an external page, you can't use page transitions such as slideup etc
More reading here: http://jquerymobile.com/demos/1.0a4.1/#docs/pages/docs-navmodel.html
i'm not sure if you can do it this way or it might be a cross domain issue.
精彩评论