Compatibility with IE8

Dec 30, 2011 at 4:19 PM

I recently used this library on a project and encountered a problem with IE9 set to work in IE8 document mode. A portion of the code I used is below:

<script src="../style%20library/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../style%20library/scripts/jquery.SPServices-0.7.0.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
$('nobr:contains("Name of person other than Joe.")').closest('tr').hide();
var userName = $().SPServices.SPGetCurrentUser({fieldName: 'Title'});
var userEmail = $().SPServices.SPGetCurrentUser({fieldName: 'EMail'});

When I used the developer tool with IE9 and reached the variables for userName and userEmail, both were blank. I then tried Chrome (16.0) and both values displayed correctly. I changed the compatibility mode with IE9 to IE9 and both values were found and entered correctly. I then located an IE8 browser and verified that the values were not selected. For the record, the debugger showed the values going from undefined to an empty string. I tested this result in several different environments on two other networks. I also tested IE7 and it appears that only IE9 Document mode works. Is there something I am missing?

Dec 30, 2011 at 4:35 PM

I can't seem to reproduce this. I've tried setting IE9 to IE8 more and IE7 mode, and I still get the results I expect. Is it possible that you have another error in your script you haven't caught?


Dec 30, 2011 at 4:40 PM
Just a hunch...
Check the page's <!DOCTYPE> and report back on what it is set to (and that it appears at the top of the HTML)...

I recently uncovered some issues with jQuery and how it behaves in "quirks mode" with newer browsers. Note that in my case, it had nothing to do with SPServices.

I think the utility he's trying to use scrapes a page... it may be good to also check the <!DOCUMENT> tag on that one (although, I have a feeling you .load() it via jQuery... if that is the case, then no need).


Dec 30, 2011 at 5:04 PM

Yup, it's a simple jQuery .ajax() call to grab userdisp.aspx, and I parse the values from it.


Dec 30, 2011 at 5:30 PM

I checked the <!DOCTYPE> and it is reads:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

There is no tag for <!document> that I find.


Dec 30, 2011 at 5:35 PM
I meant DOCTYPE... Sorry about the confusion.

Sent from mobile device.

Dec 30, 2011 at 6:06 PM


No problem. I am currently prepping a test environment to strip the code down to the basic function and determine the results. I will post back when completed. Thanks for your input.

Dec 30, 2011 at 7:05 PM


On closer look... is that the complete <!DOCTYPE>?  or did you miss the closing '>' at the end.

I just checked my notes on a problem I was having with jQuery's UI .dialog()... In this thread, I found the resolution that asked for the <!DOCTYPE> to be set correctly... So for you, it should be:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
See if perhaps this solves your problem... Here is more info. on <!DOCTYPE>:




Dec 30, 2011 at 7:24 PM

Very strange. In my test environment, it immediately picks up the name and email as I wanted in all browsers. Not only does it work locally, but my test environment is joined to the network and I could retrieve the information from other browsers on other desktops. However, when I applied this stripped down version to the production environment, I encountered the same problem...empty strings. The only way it picked up the correct values was to used F12 and set the browser to IE9 document. I checked that my test environments DOCTYPE was found it to be the same as production.

Thanks for your help in this.

Dec 30, 2011 at 7:29 PM

My guess then is that it may be a network topology or auth issue. Those are the worst to debug, IMO. In IE9's Developer Tools, look at the network traffic and see if you're getting the page back in the .ajax() request. If not, you may see something which might give you a hint as to why not.