简体   繁体   English

登录到主页的ajax加载

[英]Login to ajax loading of home page

I am trying to create a dynamic login screen where my whole 'logged in' page isnt loaded into the dom until the form validates where the login screen scrolls down into the homepage without 'actually' scrolling. 我正在尝试创建一个动态登录屏幕,在该屏幕上,我的整个“已登录”页面都不会加载到dom中,直到表单验证登录屏幕向下滚动到首页而不在“实际”滚动的情况下为止。

I was thinking of doing this by 我当时正在考虑这样做

form -> ajax -> validate -> on validate ajax load expanding div under login area and load home page with ajax -> jquery hide login area. 表单-> ajax->验证->验证ajax在登录区域下加载扩展div并使用ajax加载主页-> jquery隐藏登录区域。

Is there any easier way? 有没有更简单的方法? if I already have both pages combined currently to just hide that part of the dom? 如果我目前已经合并了两个页面以仅隐藏dom的那一部分?

In general, I'd propose to give XAJAX a try. 通常,我建议尝试一下XAJAX

The XAJAX library integrates well with PHP and eg allows to update several DOM elements at once. XAJAX库与PHP集成良好,例如允许一次更新多个DOM元素。

In general, I'd prefer to run the login-operation in a non-AJAX fashion. 通常,我更喜欢以非AJAX方式运行登录操作。 But that's more or less a matter of taste. 但这或多或少是一个品味问题。 Once the user is logged in, I'd switch to AJAX. 用户登录后,我将切换到AJAX。

Moreover, I wouldn't just hide the logged-in DOM element. 而且,我不会只隐藏已登录的DOM元素。

May be this could help you: Login y logout con PHP, MySQL, JQuery y Ajax (Spanish) http://bit.ly/tBmHtV 可能对您有帮助: 登录y登出PHP,MySQL,JQuery和Ajax (西班牙语) http://bit.ly/tBmHtV

It have worked for me. 它为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM