AJAX working both directions in map_edit.html