راستی این اسکریپتی هست که من نوشتمش با کمک Jquery :
<script src="../../plugins/forumthanks/js/jquery.js"></script>
</script>
<script type="text/javascript">
var show_loading;
var loadErrortext;
var thankbutton;
function make_ajax_thanks(post_id,post_owner) {
var thank_timer = setTimeout("alert('زمان لازم برای بررسی اطلاعات سپری شد ، دوباره سعی کنید !')", 30000);
show_loading = "<img src='../../plugins/forumthanks/user_images/loading/rotation_red.gif'> <img src='../../plugins/forumthanks/user_images/thank/thanks.png'>" ;
document.getElementById("exp_thank_btn_div_" + post_id).innerHTML=show_loading;
$("#exp_thanks_" + post_id).load("../../plugins/forumthanks/thanks.php?thank." + post_id + "." + post_owner,{ajax_thank : 1},function (responseText, textStatus, XMLHttpRequest) {
if (textStatus == "success") {
clearTimeout(thank_timer);
document.getElementById("exp_thank_btn_div_" + post_id).innerHTML= " ";
}
if (textStatus == "error") {
loadErrortext = "خطا ! دوباره سعی کنید : ";
thankbutton = loadErrortext + "<a href=" + "../../plugins/forumthanks/thanks.php?thank." + post_id + "." + post_owner + " onclick='make_ajax_thanks(" + post_id + "," + post_owner + "); return false;'><img src='../../plugins/forumthanks/user_images/thank/thanks.png'> </a>";
document.getElementById("exp_thank_btn_div_" + post_id).innerHTML=thankbutton;
}
});
}
function remove_ajax_thanks(post_id,thank_id,post_owner) {
var rem_timer = setTimeout("alert('زمان لازم برای بررسی اطلاعات سپری شد ، دوباره سعی کنید !')", 30000);
show_loading = "<img src='../../plugins/forumthanks/user_images/loading/rotation_red.gif'> تشکر من را پاک کن" ;
document.getElementById("rem_thank_btn_div_" + post_id).innerHTML=show_loading;
$("#exp_thanks_" + post_id).load("../../plugins/forumthanks/thanks.php?remove." + post_id + "." + thank_id,{ajax_thank : 1},function (responseText, textStatus, XMLHttpRequest) {
if (textStatus == "success") {
thankbutton = "<a href=" + "../../plugins/forumthanks/thanks.php?thank." + post_id + "." + post_owner + " onclick='make_ajax_thanks(" + post_id + "," + post_owner + "); return false;'><img src='../../plugins/forumthanks/user_images/thank/thanks.png'> </a>";
clearTimeout(rem_timer);
document.getElementById("exp_thank_btn_div_" + post_id).innerHTML=thankbutton;
if(document.getElementById("rem_thank_btn_div_" + post_id))
{
document.getElementById("rem_thank_btn_div_" + post_id).innerHTML= " ";
}
}
if (textStatus == "error") {
loadErrortext = "خطا ! دوباره سعی کنید : ";
thankbutton = loadErrortext + "<a href=" + "../../plugins/forumthanks/thanks.php?remove." + post_id + "." + thank_id + " onclick='remove_ajax_thanks(" + post_id + "," + thank_id + "); return false;'>تشکر من را پاک کن </a>";
document.getElementById("rem_thank_btn_div_" + post_id).innerHTML=thankbutton;
}
});
}
</script>
اون یک تیکه مربوطه به Jquery رو چه طوری میتونم با یک اسکریپت دیگه جایگزین کنم که وابسته به Framework خاصی نباشه ؟
چون یک بخشی از کارم از طریق متود پست انجام میشه . اگر یک کمکی کنید یک کد جایگزین براش درست کنم خیلی ممنونتون میشم .