dynamic http/https switching for jqueryy