我想将值传递给 JavaScript 中的变量。这些值是 json 格式的响应。
$.getJSON('url.php?id=login&email='+document.getElementById("txtemail").value+'&password='+document.getElementById("txtpassword").value, function (data)
{
alert(data.status);
alert(data.msg);
alert(data.user_id);
alert(data.session_id);
});
我想将 session_id 存储在变量中,然后必须将其发送到 url。我怎样才能做到这一点? 感谢您的帮助...
最佳答案
你的意思是这样吗?
var ses_id = data.session_id;
jQuery.post("<url>?session_id="+ses_id);
关于javascript - 将值传递给 javascript 中的变量,其中这些值是 json 中的响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9373513/