I have an issue where I need to load a piece of my SharePoint 2010 site (header, navigation/search) into another .html page. In general, I want it to look like the following:

<!doctype html>
  <HEAD>  </HEAD>

  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

   <div id="HeaderFrame">

   <script language="javascript">
    // index.html would be replaced with main sharepoint 2010 page to load //

   <iframe id="DashboardiFrame" scrolling="no" name="dashboard" frameBorder="0" src="blank.html">
      <p>Your browser does not support iframes.</p>


I can't seem to get the notation correct (or something). I always get the

_spBodyOnLoadFunctionNames' is undefined


I'm up for any options to get this to work.

  • 2
    Why not just use the Page Viewer Web part and have it include Index.html rather than try to shoehorn the SharePoint chrome into a place it doesn't normally run?
    – Dave Wise
    Commented Feb 25, 2013 at 17:26
  • Is this html page going to be hosted on whatever sharepoint environment site you are trying to grab from? Commented Mar 5, 2013 at 0:11

1 Answer 1


jQuery.load allows you to pass in a selector to into the url. So you can grab just the top nav bar with something like the following:

$("#HeaderFrame").load("/sharepointsite/default.aspx .s4-tn")

However, that will likely throw some script errors (just like you described) because none of the sharepoint javascript will be loaded on your custom html page. Plus it will look silly since you won't have any of the SharePoint css loaded either. Your best shot is to try loading the sharepoint page's header, then load your topnav(or whatever piece you're after).

//1.Load the SharePoint head  
$("head").load("/sharepointsite/default.aspx head").done(function(){
    //2. Load the SharePoint top nav
    $("#HeaderFrame").load("/sharepointsite/default.aspx .s4-tn");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.