#Description:
Calling SPServices() from a page located at root website Pages library (e.g. http://<server>/Pages/default.aspx) to access a list at same level (e.g. http://<server>/Lists/MyList) might try to access an incorrect URL.
#Steps to reproduce:
1. Create a Publishing site
2. Create a page in /Pages library (e.g. default.aspx)
3. Create a custom list in /Lists (e.g. MyList)
4. Use following code in default.aspx from a Content Editor Web Part pointing to existing file with the code (SP2010):
```
$().SPServices({
operation: "GetListItems",
async: false,
listName: "MyList",
CAMLQuery: "",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function(xData, status)
{
if (status == "error")
{
console.log("Error: " + xData.statusText);
}
else
{
var rows = $(xData.responseXML).SPFilterNode("z:row");
console.log("Rows retrieved: " + rows.length);
}
}
});
```
5. Save and browse the page
6. Console will display the message "Error: Transport error" as jQuery AJAX request tries to access //_vti_bin/Lists.aspx instead of /_vti_bin/Lists.aspx (notice the double-slash at the beginning).
#Workaround:
Modify jquery.SPServices-2013.01.js file at line 428 from:
```
ajaxURL = $().SPServices.SPGetCurrentSite() + SLASH + ajaxURL;
```
so it runs following code:
```
var currentSite = $().SPServices.SPGetCurrentSite();
ajaxURL = currentSite + (currentSite !== SLASH ? SLASH : "") + ajaxURL;
```
Calling SPServices() from a page located at root website Pages library (e.g. http://<server>/Pages/default.aspx) to access a list at same level (e.g. http://<server>/Lists/MyList) might try to access an incorrect URL.
#Steps to reproduce:
1. Create a Publishing site
2. Create a page in /Pages library (e.g. default.aspx)
3. Create a custom list in /Lists (e.g. MyList)
4. Use following code in default.aspx from a Content Editor Web Part pointing to existing file with the code (SP2010):
```
$().SPServices({
operation: "GetListItems",
async: false,
listName: "MyList",
CAMLQuery: "",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function(xData, status)
{
if (status == "error")
{
console.log("Error: " + xData.statusText);
}
else
{
var rows = $(xData.responseXML).SPFilterNode("z:row");
console.log("Rows retrieved: " + rows.length);
}
}
});
```
5. Save and browse the page
6. Console will display the message "Error: Transport error" as jQuery AJAX request tries to access //_vti_bin/Lists.aspx instead of /_vti_bin/Lists.aspx (notice the double-slash at the beginning).
#Workaround:
Modify jquery.SPServices-2013.01.js file at line 428 from:
```
ajaxURL = $().SPServices.SPGetCurrentSite() + SLASH + ajaxURL;
```
so it runs following code:
```
var currentSite = $().SPServices.SPGetCurrentSite();
ajaxURL = currentSite + (currentSite !== SLASH ? SLASH : "") + ajaxURL;
```