Javascript-how can this effect be achieved?

Source: Internet
Author: User
Many websites have such a third-party login function. Click login to bring up a small window. after confirmation is made in the small window, it is immediately closed, let the post-master page Avatar be loaded ,.,, How is this implemented? Partial refresh involves ajax, but like...

Many websites have such a third-party login function. Click login to bring up a small window. after confirmation is made in the small window, it is immediately closed, let the post-master page Avatar be loaded ,.,, How is this implemented? Partial refreshing involves ajax, but the address in the small window in the figure is completely a third-party interface. how can I use ajax to control and return the information to the home page?

Reply content:

Many websites have such a third-party login function. Click login to bring up a small window. after confirmation is made in the small window, it is immediately closed, let the post-master page Avatar be loaded ,.,, How is this implemented? Partial refreshing involves ajax, but the address in the small window in the figure is completely a third-party interface. how can I use ajax to control and return the information to the home page?

The landlord can see the oauth login authorization, https://segmentfault.com/a/1190000005177874 landlord can study this code

Https://adodson.com/hello.js/

I tried to write user-authorized JavaScript code.

This is generally the case.
When a user triggers a logon, the program checks whether a logon token exists in the local storage. a window pops up or jumps to the logon page on our side. some information such as the application id and the callback address is displayed. after successful logon, it will jump to the address specified by the callback, usually the original logon page. at this time, it will jump to the new page with the token. At this time, you can use this token to access other APIs, such as user information and friends.

Http://www.uyan.cc/getcode, this kind of thing, it's good to have a third party.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.