日期:2014-05-16 浏览次数:20881 次
function OnPostSpeak()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("POST","rfc4627",true);
xmlhttp.onreadystatechange = OnPostSpeakResponse;
xmlhttp.setRequestHeader("Content-Type", "application/json");
var speaker = document.getElementById("speaker").value;
var headline = document.getElementById("headline").value;
var type = document.getElementById("type").value;
var time = document.getElementById("time").value;
var period = document.getElementById("period").value;
var SpeakObject = {
"speaker":speaker,
"headline":headline,
"type":type,
"time":time,
"period":period};
var JsonObject = JSON.stringify( SpeakObject );
xmlhttp.send( JsonObject );
}