This project has moved and is read-only. For the latest updates, please go here.

SPGetListItemsJson not using defaults.webURL

Jul 29, 2014 at 3:58 PM
I am attempting to call the SPGetListItemsJson method with a default webURL, and it is not working. I am using version jquery.SPServices-2014.01 on a 2012 TFS server.

I noticed in the source code:
$.fn.SPServices.SPGetListItemsJson = function(options) {

        var opt = $.extend({}, {
            webURL: "", // [Optional] URL of the target Web.  If not specified, the current Web is used.
            listName: "",
I replaced this with:
$.fn.SPServices.SPGetListItemsJson = function(options) {

        var opt = $.extend({}, {
            webURL: $.fn.SPServices.defaults.webURL, 
            listName: "",
This seemed to do the trick for me locally, but I am worried about having to fix this whenever there is an update. I wanted to know if I was doing something else wrong, and if not make you aware of the issue.
Jul 30, 2014 at 1:17 PM
It looks like you've caught a bug. I'd suggest that you simply pass in the webURL on each call rather than changing the SPServices code. I'll get a fix into the next release.

Jul 30, 2014 at 1:18 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.