Fix js for #13 and still allow ajax init for backwards compatibility