1

I have added a Page viewer web part on a page. and call other SharePoint web page. I need to remove menu bar etc on this page. I got a below Jquery code from this portal.

<script type="text/javascript">
$(document).ready(function(){
    var mySiteIframe = $("#MSOPageViewerWebPart_WebPartWPQ2");
    mySiteIframe.load(function(){
        window.console && console.log('Loading Iframe');
        mySiteIframe.contents().find("#suiteBar").css("display", "none");
    });
});
</script>

but I do not know where/how this function call on page. Please guide me.

  • 1
    You need to edit the page you display in the page viewer. Otherwise jQuery that you load on the host page cannot access the page in the IFrame. – Alexey Krasheninnikov Nov 5 '14 at 8:06
  • 1
    When you actually load your sharepoint page into the frame, you could also set the isDlg=1 query string parameter, and sharepoint will hide all those extras for you. – russellg Nov 11 '14 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.