How to pass data from JavaScript to PHP

Source: Internet
Author: User
How do I pass the data in JavaScript to PHP?
The current situation is this:
Using the Sina API to implement the login will invoke the JS callback function:

function Login (o) {

}


The parameter o is the JSON of the user information, now I want to take out this data in front of the display,
But PHP is executed in the background, so I want to jump to another PHP page with Window.location.href,
At the same time, the question is how to pass this O to the PHP page?

Don't know if using form is feasible? Are there any common methods recommended


------Solution--------------------
Reference:
Http://stackoverflow.com/questions/2367979/pass-post-data-with-window-location-href
Do not post.
Only the parameter is set to the Window.location.href URL, which is equivalent to get, but get has a word length limit, in addition makes the URL ugly.
Of course there is a way to use cookies. However, there are many legal restrictions on cookies in many countries.
------Solution--------------------

References:
why not post, feel good post.

The explanation is not clear, so quoted StackOverflow's question and answer, that is a global question and answer forum, master such as cloud.
  • 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.