SPServices-2013.01.js line 428 question

Oct 18, 2013 at 6:48 PM
Edited Oct 18, 2013 at 6:48 PM
I just started working with Office 365 SharePoint but have used SPServices with SP2007. With IE10/Win7/jquery-1.10.2.js/jquery.SPServices-2013.01.js I'm seeing this in the console: "XMLHttpRequest for https//_vti_bin/Lists.asmx" which results in an error, "Network Error 0x80070005, Access is denied."

This error does not occur when the double slash is changed to a single slash. To me, it looks like line 428 in SpService-2301.01 may be where the double slash is coming from.
ajaxURL="_vti_bin/Lists.asmx"
opt.webURL=""

line 428>  ajaxURL = $().SPServices.SPGetCurrentSite() + SLASH + ajaxURL;
as $().SPServices.SPGetCurrentSite()' value is "/" and SLASH's value is "/"
Coordinator
Oct 18, 2013 at 7:04 PM
Yup, it's a bug. I'm creating the ajaxURL improperly in 2013.01 only if you're in the root site.

I have a fix in the 2013.02 alpha. I'd appreciate it if you could try it out and let me know if you have any problems on this issue:
https://spservices.codeplex.com/workitem/10165

M.
Oct 18, 2013 at 7:14 PM

Hi,

That worked.

I didn’t think to look through the ISSUES before posting to the Discussions.

Thank you for your ultra-quick response.

Mark Johnston

PS In a non-SPServices way of thanks, here is some of my code to handle two related date fields, Open and Closed:

$(document).ready(function() {

$("input[title='Open']").parentsUntil("td.ms-formbody").parent("tr").mouseleave(function() {

var date1= $("input[title='Open']").val();

var date2= $("input[title='Closed']").val();

if (date2.length < 1) {

$("input[title='Closed']").val(date1);

}

});

$("input[title='Closed']").parentsUntil("td.ms-formbody").parent("tr").mouseenter(function() {

var date1= $("input[title='Open']").val();

var date2= $("input[title='Closed']").val();

if (date2.length < 1) {

$("input[title='Closed']").val(date1);

}

});

});

// http://www.balestra.be/2011/04/sharepoint-2007-2010-jquery-presave-action-to-validate-items-before-you-save-it.html

function PreSaveAction() {

/* Check if the contact was not in the future */

var date1= $(":input[title='Open']").val();

var date2= $(":input[title='Closed']").val();

var arrDate1 = date1.split("/");

var useDate1 = new Date(arrDate1[2], arrDate1[0]-1, arrDate1[1]);

var arrDate2 = date2.split("/");

// this duplicates the required field function in SharePoint, probably better just to make it a required field

if (arrDate2.length!=3) {

alert("Please define the Closed date.");

var fieldConc = $(":input[title='Closed']");

fieldConc.focus();

return false;

}

var useDate2 = new Date(arrDate2[2], arrDate2[0]-1, arrDate2[1]);

var todaysDate = new Date();

if(useDate1 > useDate2) {

alert("Your Closed Date occurs before your Start Date. Please re-pick dates.");

var fieldConc = $(":input[title='Closed']");

fieldConc.focus();

return false;

}

if (todaysDate > useDate2) {

alert("The specified time ends in the past. Please re-pick dates.");

var fieldConc = $(":input[title='Closed']");

fieldConc.focus();

return false;

}

return true;

}