make jquery work on either secure or insecure protocol