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.