我需要使用 AJAX 发送登录状态,这是我的代码:
<img style="display:none;" src="https://twitter.com/login?redirect_after_login=%2Fimages%2Fspinner.gif" onload="show_login_status('Twitter', true)" onerror="show_login_status('Twitter', false)" />
<div id="fb-root"></div>
<script type="text/javascript">
function show_login_status(network, status)
{
if (status)
{
alert("Logged in to " + network);
}else{
alert("Not logged in to " + network);
}
}
</script>
如何从此代码创建一个字符串,该字符串将 AJAX 用于发送...
$.ajax
({
type: 'POST',
url: 'save.php',
cache: false,
data: {
social : <SOME STRING>,
},
});