Synchronous XMLHttpRequest Warning with SPServices and Recent Browsers
If you’re working in the latest versions of Chrome (~40+) – and maybe Firefox – and you use SPServices, you may start to see an warning:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check http://xhr.spec.whatwg.org/.
Vigilant SPServices user frankhale reported this to me the other day in the SPServices discussions on Codeplex, which is – at least at the moment – the best place to get help with SPServices. You can also add an issue on Github (sympmarc / SPServices) if that’s your fancy.
The warning is thrown in jQuery, not SPServices, but it’s an SPServices issue.
First off, it’s a warning, not an error. Your code will continue to work in the near term, at least.
Because of some backward compatibility concerns, I’ve left a few synchronous calls internally to SPServices in place. Those calls are what are causing the warning. In particular, it is most likely that the warning is being thrown for you because of a synchronous call on the $().SPServices.SPGetCurrentSite function. The reason for this is that early in the SharePoint 2007 days it was difficult to determine the current site without a call to the Webs.WebUrlFromPageUrl operation. Unfortunately, it seems that I’m making that call in SharePoint 2010 and 2013, even though the current site is available in JavaScript variables.
So, the bottom line is: “Carry on.” I’ll get a fix into the next release of SPServices for this. In the meantime you should be fine.
you got solution for this as i am using cascading drop down it seriously having detrimental effect.
@rahul:
Can you explain your issue more fully? How many cascades? How much data, etc.?
M.
Hi Marc,
I am using $().SPServices.SPAutocomplete which pulls data from other list and based on selected value I am also auto-populating data for other columns using $().SPServices. The first service is working without any issue but auto-populating data for other columns is not working. I am using jquery.SPServices-2014.01.js in SharePoint 2013 and using IE11. Could you please help me here.
Akash:
Can you explain what is happening where it doesn’t work? What types of columns are they? Have you tried 2014.02?
M.
Marc:
Please find my piece of code below.
$().SPServices is not hitting here. But the same code is working well with SP2010. All columns are Single Line of Textboxes. I also tried 2014.02 but its not working.
Let me know if you need more info.
CAML query did not get pasted here. Code works only till there but not hitting $().SPServices
Marc
Could you please help me on my query.