It's not clear what are you asking about; and this is not a question, but — it's apparent that your code is wrong: under the
success
function implementation, you try to use something similar to object property definition syntax "error:function(){}", which is invalid under the function body block "{}", could only be valid under the object-definition block. It throws the following exception:
SyntaxError:
function statement requires a name
(Exception detail may depend on the browser.)
As this is a syntax error, you could not even catch it as if you normally could do with other exceptions; it makes your whole script defunct. I have no idea how could you observe "code code is fired in last and only last time" and what it could possibly mean. For further detail on dealing with lexical errors, please see the section in my article:
JavaScript Calculator, 5. Handling Lexical Errors.
However, you should better just fix the syntax. Just look more thoroughly at jQuery Ajax usage:
http://api.jquery.com/jquery.ajax[
^],
http://api.jquery.com/category/ajax[
^].
—SA