UPDATE: SharePoint 2010, IE 7, and JQuery Issues

This is an update to an earlier post about issues with the style library, IE 7, javascript, REST interface, and anonymous access (yea, it was a lot of stuff). Here is what we have learned:

  • If you have publishing turned on, you have to make double triple dog sure that your files are PUBLISHED when you push to test, uat, prod, whatever. If anything is in draft mode and you have anonymous access turned on user will get a login screen. We thought there was an issue with the Style Library and anonymous access but it was just files in draft mode causing the problem. You can check for draft files and publish them by using Site Actions > Manage Content and Structure
  • If you are using the REST interface with javascript it won’t work once you turn on anonymous access. You will have to redo your code or find a different solution-our programmer is busy right this second redoing all the beautiful code he wrote because we had no idea it didn’t flippin work when anonymous access was turned on 😦 We tried everything we could to make it work-we reached out to all the SharePoint pros at our company, on the web, even called SharePoint 911 (why is it whenever I call SharePoint 911 I have an issue that is impossible to fix??). So, in short, wanna use the REST interface? Don’t use javascript to query your lists, write a custom service instead.
  • I think the last issue was IE7 not liking Jquery. Our programmer had to rewrite his code a bit to make it play nice iwth IE 7-I’ll get him to tell me exactly what he did so I can let you guys know 😉

We are sooo close to launching the new ms.gov, just a few more days!!!! I designed this little guy over the New Years holiday (holiday? HA!).

Advertisements

SharePoint 2010, IE 7, and JQuery Issues

My company is launching our first version of a new state portal in a few weeks and during testing with IE 7 on a test VM, half our pages didn’t show up properly. Our issues appear to be two-fold: IE 7 has known issues with JQuery, and once anonymous access or read-only access for SharePoint 2010 is turned on the style library doesn’t work consistently.

We are using JQuery and REST to pull data from SP lists into display pages. This works great on newer browsers and signed in with Contributor and above access. The minute we sign in with a test user with read only access the style library starts bombing out and half the files within it serve and the other half don’t. If I give the test users contribute access to the style library the issues go away. Unfortunately, once we go to production and turn on anonymous access, I can no longer do this as no users with anonymous access can be given contribute access to any lists, or so says what I have read about SharePoint.

We found a few blog posts that might help us, as we are not the only ones with issues with anonymous access and the style library flaking out. Our developer has the fix for IE 7-I am hoping once that is implemented the site will at least all display in IE 7.

Anyone else have issues with anonymous access and the style library? Any ideas, tips, input would be greatly appreciated. And of course, once we figure out how to overcome all these issues I will post the solutions here, as I have found after all these years if I am having a SharePoint issue, a lot of other folks are too.

Happy SharePointing and Merry Christmas!

JQuery Tip: Use JQuery to alter css

This is a quick tip if you want to easily override some css or hide some elements on a specific page, using JQuery is really easy and it works well. Of course, the example below is overkill as you can easily use css to do the same thing, I am simply showing that it is possible.

1: make sure you have a link to JQuery in your master page in the HEAD:

<script src="'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>  

2: add a content editor web part to the page you wish to alter

3: use the css() method to target any html tag, css class or id
EXAMPLE:
Say you want to hide the quicklaunch on a page. Use the IE Developer tools to inspect the page and find the outer wrapper for the quicklaunch (.ms-quicklaunchouter). Now add the following code to your content editor web part in code view:


<script>
$(document).ready(function() {
$('.ms-quicklaunchouter').css('display','none');
});

</script>

The area where the .ms-quicklaunchouter is displaying is where you would reference any html tag, ID, or class. ‘Display‘ is where you reference the property, and ‘none‘ is where you reference the value. With this one method you can override pretty much anything on your site.

If you want to override a style across your site collection, create a functions.css file, link it to your masterpage under the initial JQuery link, and put all of your functions there.