Embedded Explorer View Not Working


Explorer View fails to launch when it is selected from the ‘Views:’ drop down on the top right of the document library web part (this is opposed to launching Explorer View by clicking ‘Actions’ -> ‘Open with Windows Explorer’).

In IE7 this should display Windows Explorer on the page itself embedded in an iframe, when this problem occurs the iframe displays a blank page instead. IE8 and IE9 a separate Windows Explorer window should be opened but the problem means it fails to do so.


Upon selecting Explorer View the page does a post back and the JavaScript function that launches it (called ‘navtoframe2’) is meant to be called by the body’s onload event.

How this actually works:

The body element is contained in the master page while the document library itself will be in one of many content pages, these content pages also could have any number of functions on them that need to be called by the same onload event. Microsoft’s way of accomplishing this is by adding their names to a global array called ‘_spBodyOnLoadFunctionNames’ while the page is loading.

The master page’s onload event actually calls ‘_spBodyOnLoadWrapper()’, contained within the ‘LAYOUTS\1033\INIT.JS’ file, this goes through ‘_spBodyOnLoadFunctionNames’ calling each function.

The client’s issue was that someone had deleted the onload attribute from the body tag of a de-ghosted master page, this was a fairly easy fix by having them re-add it.

onload=”javascript:if (typeof(_spBodyOnLoadWrapper) != ‘undefined’) _spBodyOnLoadWrapper();”

While we’re on the subject of the onload event a good tip is to stay away from the window.onload property when working with SharePoint as this will be overwritten by the body’s onload attribute. I imagine JQuery’s (rather excellent) .ready() function would cause problems too.

About dannymelia

Women want me. Men want to be me. Animals want to learn how to talk so they can hang out with me. I'm trying the sunglasses on in the shop which is why there is a label on my face. View all posts by dannymelia

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: