Replace ugly js with ajax.