如何在jQuery Mobile中刷新页面 [英] How to refresh the page in jQuery Mobile

查看:76
本文介绍了如何在jQuery Mobile中刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我创建了多页文件的单页,即。 FindEmp.html有以下多页

 1。 divLanding< br /> 
2. divResult< br />
3. divDetails





当用户登录时应用程序将用户重定向到divLanding。

在divLanding中,用户可以通过提供员工姓名来搜索公司员工。

当用户点击divlanding上的搜索按钮时,页面将被重定向:

 $ .mobile.changePage('#divResult',{转换:slide,changeHash:false}); 



divResult显示名称与用户提供的名称相匹配的员工列表。

在列表中,用户可以查看将用户重定向到divDetails页面的员工的个人资料,其中使用以下内容显示员工的更多详细信息:

 $(document).on('click','#btnVwProfl',function(){
var result = $(this).parents('。ui-grid-a')。find('#lblempID ')。text();
// alert(empid);
// getOrgList(empno);
empno = result;
$ .mobile.changePage(#divDetails ,{transition:slide,reloadPage:false,changeHash:true});
});



组织herirachy list t他是员工协调员和共同员工,用户可以点击列出的员工姓名,这样可以显示个人详细信息。



我试过以下代码

 $(#ulList)。on('click',li,function(e){
e.stopPropagation();
empno = $(this).find('a')。eq(0).attr('id');
$ .mobile.changePage(window.location.href,{allowSamePageTransition:true,changeHash:true});
});





问题:

以上代码导致页面重定向到 FindMastekeer.htm ,这会导致显示divlanding。所以细节不会显示给用户。



如何避免此页面重定向?



有什么想法或建议吗?



提前致谢

解决方案

.mobile.changePage('#divResult' ,{transition:slide,changeHash:false});



divResult显示其名称与用户提供的名称相匹配的员工列表。

在列表中,用户可以查看将用户重定向到divDetails页面的员工的个人资料,其中使用以下内容显示员工的更多详细信息:

 


(document).on('click','#btnVwProfl',function(){
var result =


(this).parents('。ui-grid-a')。find('#lblempID')。text();
// alert(empid);
// getOrgList(empno) ;
empno = result;

Hi friends,
I have created single page with multi document ie. FindEmp.html has following multi page

1. divLanding<br />
2. divResult<br />
3. divDetails



As user login the application the user is redirected to divLanding.
In divLanding the user can search the company employee by providing the employee name.
When the user clicks the search button on divlanding, page is redirected using following:

$.mobile.changePage('#divResult', { transition: "slide", changeHash: false });


divResult display the list of employee whose name match the name provided by the user.
In the list the user can view the profile of the employee which redirects the user to divDetails page where more details of the employee is displayed with his/her organisation herirachy using following:

$(document).on('click', '#btnVwProfl', function () {
                var result = $(this).parents('.ui-grid-a').find('#lblempID').text();
                //alert(empid);
                //getOrgList(empno);
                empno = result;
                $.mobile.changePage("#divDetails", { transition: "slide", reloadPage: false, changeHash: true });
            });


Organisation herirachy list the employee co-ordinates and co-employees and user can click the listed employee name which causes the person details to be displayed.

I tried following code

$("#ulList").on('click', "li", function (e) {
       e.stopPropagation();
       empno = $(this).find('a').eq(0).attr('id');
       $.mobile.changePage(window.location.href, { allowSamePageTransition: true, changeHash: true });
                           });



Problem:
The above code causes the page redirected to FindMastekeer.htm which causes the divlanding to be displayed. So the details is not displayed to the user.

How can I avoid this page redirection?

Any ideas or suggestion?

Thanks in advance

解决方案

.mobile.changePage('#divResult', { transition: "slide", changeHash: false });


divResult display the list of employee whose name match the name provided by the user.
In the list the user can view the profile of the employee which redirects the user to divDetails page where more details of the employee is displayed with his/her organisation herirachy using following:


(document).on('click', '#btnVwProfl', function () { var result =


(this).parents('.ui-grid-a').find('#lblempID').text(); //alert(empid); //getOrgList(empno); empno = result;


这篇关于如何在jQuery Mobile中刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆