SPGetCurrentUser Sizzle error

Jan 8, 2014 at 5:18 PM
Edited Jan 8, 2014 at 5:19 PM
My JavaScript skills are pretty rusty Marc, so I've been slowly debugging SharePoint 2010 in IE9. The error I encounter (returned from the Sizzle library) seems to be where the "find" attempts to scrape the field value (Name) from the userdisp.aspx page.

2293: $(thisUserDisp.responseText).find("table.ms-formtable td[id^='SPField']").each(function() {

Here are the versions of jquery and SPServices I am referencing.
jquery-1.9.0.js
jquery.SPServices-2013.02a.js

I believe my simple alert code is correct, because if I request the fieldName: "ID" I get a value of "2" returned and the other functions work fine.

var userName = "";
$(document).ready(function() {
alert("jQuery");
alert($().SPServices.SPGetCurrentSite());
userName = $().SPServices.SPGetCurrentUser({fieldName: "Name"});
alert("userName: " + userName);
});

Here's the error...and the first part of the return (which appears to be the entire page that was passed to the find to be scraped):
...................................
SCRIPT5022: Syntax error, unrecognized expression: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr">
<head><meta http-equiv="X-UA-Compatible" content="IE=8" /><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><title>
Personal Settings
...............................

Any words of wisdom or something simple I may have missed?

Thanks...Russ
Coordinator
Jan 8, 2014 at 5:54 PM
There are known issues with the minified version of jQuery 1.9.0, so I'd suggest switching to 1.10.2.

Let me know if the issue still exists at that point.

M.
Jan 8, 2014 at 10:37 PM
Bullseye, Marc! I am now using 1.10.2 (non-minified) and it worked the first time. I guess I should've just tried it without bothering you first.

I had settled on 1.9.0 because I read 1.9.1 had issues, thinking that older might be a little more stable, but I was completely wrong in this regard.

Thanks for your quick response.

Russ
Coordinator
Jan 9, 2014 at 3:58 PM
Both of the 1.9 releases had issues and they were short-lived.

M.