Onclick function encapsuled / AJAX get method modified