changed ajaxurl to match protocol as this seemed to be causing issues