Quote:
Originally Posted by Abe1
I need to learn how to use prototype first. I've tried but failed so far.
|
i've tried to do so:
Code:
function post_thanks_give_(pid)
{
fetch_object('post_thanks_button_'+pid).style.display = 'none'
do_thanks_add = new vB_AJAX_Handler(true)
do_thanks_add.onreadystatechange(thanks_add_Done)
do_thanks_add.send('showthread.php?do=post_thanks_add_ajax&p='+pid)
}
function thanks_add_Done() {
if (do_thanks_add.handler.readyState == 4 && do_thanks_add.handler.status == 200) {
fetch_object('post_thanks_box_'+manualinsertedpostid).innerHTML = do_thanks_add.handler.responseText+pid
}
}
i've moved this code to showthread template and cleaned post_thanks_box template. I've also modified all links in hack's templates to use post_thanks_give_('$postid') function, but i couldn't get postid in function thanks_add_Done.
if
Code:
function post_thanks_give_(pid)
{
fetch_object('post_thanks_button_'+pid).style.display = 'none'
do_thanks_add = new vB_AJAX_Handler(true)
do_thanks_add.onreadystatechange(thanks_add_Done(pid))
do_thanks_add.send('showthread.php?do=post_thanks_add_ajax&p='+pid)
}
function thanks_add_Done(pid) {
if (do_thanks_add.handler.readyState == 4 && do_thanks_add.handler.status == 200) {
fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_add.handler.responseText+pid
}
}
there is an error
do_thanks_add.handler.readyState is null or non-object