Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

What is best way to remove init.js and core.js for an anonymous publishing site?

  Asked By: Aaditya    Date: Mar 20    Category: Sharepoint    Views: 4811

I am looking to improve the page load time of my publishing site and want to prevent files such as core.js and init.js being downloaded for read only users.

How do people generally go about doing this? I have read this


and this


My master page is completely customized but contains the following standard MOSS WCM javascript on the body and form tags. (I am assuming these are required in authoring mode?). How do people typically remove these wired events in read only mode if we prevent init.js from loading using one of the methods above?

<body onload="javascript:_spBodyOnLoadWrapper();">
<form id="Form1" runat="server" onsubmit="return _spFormOnSubmitWrapper();">



1 Answer Found

Answer #1    Answered By: Asia Meyers     Answered On: Mar 20

Andrew Connell has some good coverage on this issue in his book Sharepoint 2007 WCM Development. In the code downloads for his book he offers a control which suppresses the javascript files  as necessary for authorised and anonymous  users.

The code download is here, and Chapter 19 is what you need to reference;


There's an article on the topic by a different author here;


If you're sold on the usefulness of Andrew Connells book it can be obtained here;


It goes into much more depth than I can here (wouldn't be right to quote it verbatim!)