changed protocol for resources, passed jQuery into main closure