Replace iframe mechanism with ajax request to avoid cross origin issue