Do not specify either HTTP or secure HTTPS protocol for JS resources so that they can load on the current protocol.