SharePoint 2010 Ribbon Button Error – "Access is denied. sp.ui.rte.js…"

Heather WatermanHeather Waterman (@hwaterman) and I turn to each other fairly regularly when either of us is stuck on something that we know the other will understand better. It’s the tremendous value of the SharePoint community along with the crazy tools like Skype that we have these days. (When I started coding, it was hard enough to get the attention of the person sitting next to you, much less someone across the hall or on the other side of the world. Or South Carolina.) All that and the fact that Heather is an all around good egg, and it’s a win for me at least!

Today I was having a problem where the buttons on the SharePoint 2010 ribbon weren’t working correctly. When I popped open the Developer Tools in IE9 (by hitting F12), I could see this error every time I clicked on one of the ribbon’s Rich Text formatting buttons.

image

That’s “SCRIPT5: Access is denied.  sp.ui.rte.js?rev=uY%2BcHuH6ine5hasQwHX1cw%3D%3D, line 2 character 267202”. Sure, it made sense to me, too.

I found several blog posts, each of which had interesting suggestions (e.g., add the site to the Trusted Zones or check for empty CSS or JavaScript files), but none of them worked for me.

Off to Skype to ask Heather, the expert. She had seen this issue before, but the tips above had solved it in the cases she could remember. We started marching through my custom master page and CSS to see what we could find.

Long story short, I was loading jQuery, jQueryUI, and SPServices from CDNs, using the txt file I describe in my post called, aptly enough, Referencing jQuery, jQueryUI, and SPServices from CDNs. I would have thought that since the error was about one of SharePoint’s js files, the issue would have been with one of the js files I was loading from the CDNs. However, it turned out to be the jQueryUI CSS file, not any of the script files.

I’m not sure that it is part of the cause, but because I’m working on a new SharePoint Internet site in stealth mode, I have the IP address in my hosts file. My guess is that this causes an issue with loading CSS files from another domain.

Well ,thanks to Heather I have the rest of the afternoon to do other useful things rather than spending more time on this silly issue. Thanks, Heather!