SPServicesContext Bug

Aug 9 at 5:51 PM
Edited Aug 9 at 5:54 PM
Found a really off-the-wall edge-case issue in my local dev environment running 2010 stand alone with a new web app that is not running on port 80. For whatever reason, location.host was returning hostname:port instead of just hostname. As a result, the URL returned by SPServicesContext was hostname:portport instead of hostname:port which was causing any SPServices calls (most if not all of them) that rely on web services to fail silently.

Changing the first line from:
var siteRoot = location.protocol + "//" + location.host + location.port !== "" ? location.port : "");
to:
var siteRoot = location.protocol + "//" + location.host + (location.host.indexOf(":") > 0 ? "" : (location.port !== "" ? location.port : ""));
solves the problem!
Coordinator
Aug 23 at 5:30 PM
This is a "known problem" and I've fixed it in the current code base. At some point, I'll do another release!

M.