2011-01-09 44 views
0

我需要一个专家来审查这个脚本帮助,好像此Javascript没有被要求的onclick我需要FBML与阿贾克斯

功能的send()
{

VAR阿贾克斯=新的ajax();
ajax.responseType = ajax.FBML;
ajax.requireLogin = true;
ajax.ondone = function(data)
{
document.getElementById('message')。setInnerFBML(data);
}

变种的queryString = {
'消息':的document.getElementById( '消息')值,
'同上':,的document.getElementById( '同上')值,
“txt_color ':“000000”,
'name':document.getElementByID('new_name')value,
'hideme':“0”
};
ajax.post('http://test.com/it.php',queryString);

}

HTML用于调用JS功能:

< INPUT TYPE = “按钮” 值= “发送” 的onClick = “发送();”>

回答

0

您在getElementByID(注意大写D)处使用了错误的情况:

var queryString = { 
'message' : document.getElementByID('message').value, 
'ibid' : , document.getElementByID('ibid').value, 
'txt_color' : "000000", 
'name' : document.getElementByID('new_name').value, 
'hideme' : "0" 
}; 

应该是:

var queryString = { 
'message' : document.getElementById('message').value, 
'ibid' : , document.getElementById('ibid').value, 
'txt_color' : "000000", 
'name' : document.getElementById('new_name').value, 
'hideme' : "0" 
}; 
+0

仍然无法正常工作。 – user564921 2011-01-09 17:14:11