1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-03 06:55:03 +03:00
ifhub.club/templates/skin/developer/js/questions.js
2010-10-02 14:33:51 +00:00

23 lines
815 B
JavaScript

function ajaxQuestionVote(idTopic,idAnswer) {
new Request.JSON({
url: aRouter['ajax']+'vote/question/',
noCache: true,
data: { idTopic: idTopic, idAnswer: idAnswer, security_ls_key: LIVESTREET_SECURITY_KEY },
onSuccess: function(result){
if (!result) {
msgErrorBox.alert('Error','Please try again later');
}
if (result.bStateError) {
msgErrorBox.alert(result.sMsgTitle,result.sMsg);
} else {
msgNoticeBox.alert(result.sMsgTitle,result.sMsg);
if ($('topic_question_area_'+idTopic)) {
$('topic_question_area_'+idTopic).set('html',result.sText);
}
}
},
onFailure: function(){
msgErrorBox.alert('Error','Please try again later');
}
}).send();
}