Fixed javascript origin URL

dol_buildpath returns a path with a trailing slash.
This messes up the json credentials file verifications.
Get rid of this.