The problem with AJAX is that there are sometimes subtle and sometimes not so subtle differences how stuff is handled between different browsers. To alleviate that pain there are several javascript libraries that mitigate if nor completely solve the cross browser compatibility issues.
The most notable one which I would recommend to you is
jQuery[
^].
Regards,
— Manfred