English 中文(简体)
移动。 需要更新页面的换页
原标题:mobile.changepage requiring page refresh

I m 使用 $.mobile. ChangePage () 从一个 HTML 页面向另一个页面导航。 但该页面的内容并没有改变。 在这样做时, URL 页面会更改, 但新页面没有被装入。 它需要刷新才能装入 。

问题回答

您应该使用 JavaScript 函数更改页面...

window.location =  your page  ;

希望它能解决你的问题!

在上述批注提供的代码中,您可能会遇到一个错误, 显示 next_ page 尚未定义。 鉴于您正在处理 jQuery Move, 请尝试指定 点击 处理器时略为不同 :

将链接的定义更改为类似 :

<a id="btnNextPage" href="#" >Details</a>   

您不必给它一个 < code> id - 您可以仅使用选择器来识别以下 Javarint 中的链接 :

 // the event handler
 function next_page() { 
     $.mobile.changePage("http://www.google.com", {transition:"slide"}); 
 }

// assign the click event when the DOM is ready
$(function() {
      $("#btnNextPage").click ( next_page );
});




相关问题
jQuery Mobile - Dynamically creating form elements

I m creating a web-database driven offline web-app targeted at iOS devices. I m trying to use jQuery Mobile, but I have a problem in creating the various forms. The form options are taken from a ...

How to use jQuery Mobile to create iPhone Web Apps?

I have been assigned to create a web app for the iPhone, and I was supposed to try jQuery Mobile for developing as it supports many platforms. Is PHP a requirement for creating iPhone web apps? What ...

Change button text jquery mobile

I m using the new jquery mobile 1.0 alpha 1 release to build a mobile app and I need to be able to toggle the text of a button. Toggling the text works fine, but as soon as you perform the text ...

Full width horizontal buttons with jquery mobile?

In Jquery mobile, I can have grouped horizontal buttons, but they the group does not take 100% width. I tried adding a class that sets width:100% but that did not work. How can I do it? Thank you! ...

Difference between jQTouch and jQuery mobile

What is the difference between jQTouch & jQuery Mobile Framework ? Are they related (other than being both based on jQuery) ? Do they have the same goal ? Edit: jQTouch is now jQT

Long Press in JavaScript?

Is it possible to implement "long press" in JavaScript (or jQuery)? How? (source: androinica.com) HTML <a href="" title="">Long press</a> JavaScript $("a").mouseup(function(){ // ...

jQuery and mobile browser compatibility?

I want to build a relatively simple version of my site for mobile phones, but I will definitely need JavaScript and jQuery for many functions. Googling didn t help to find an answer. How is ...

热门标签