add javascript for AJAX error control