SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a sharepoint site . The javascripts seems to be working only for my home page . If i naviagate to any other pages , the javascripts are not getting executed . I observed the behavior in chrome browser the most .

share|improve this question
Are there any errors in the console? – RJ Cuthbertson Jun 27 '14 at 20:28
Looks like i have the issue mentioned – Nikhil Jangle Jun 27 '14 at 20:34
Uncaught ReferenceError: MoveSiteTitle is not defined – Nikhil Jangle Jun 27 '14 at 20:35
Uncaught ReferenceError: documentGetElementsByName is not defined – Nikhil Jangle Jun 27 '14 at 20:36
apart from home page . Any idea as to why above errors are occurring on all other pages ? ar TitleWPID = 'g_994e5206_37b2_4edb_ace7_a1fa8396e660'; // ]]> </script><script type="text/javascript"> // <![CDATA[ var logoImg = documentGetElementsByName('onetidHeadbnnr0'); if (logoImg != undefined && logoImg[0] != undefined) logoImg[0].src='/_layouts/images/siteIcon.png'; // ]]> </script><script type="text/javascript"> // <![CDATA[ MoveSiteTitle(); // ]]> – Nikhil Jangle Jun 27 '14 at 21:01

If your comments are an actual script tag in your master page - you have a syntax error on your master page which will kill all the rest of the javascript on the page.

You're missing a dot and javascript is case sensitive, so you need 'document.getElementsByName' not 'documentGetElementsByName'

var logoImg = document.getElementsByName(...)

I'm also assuming MoveSiteTitle() is a function that would otherwise be available if that first inline script was working -- but you should also make sure it is globally available.

share|improve this answer
up vote 1 down vote accepted

When viewing SharePoint 2010 from the Chrome browser, intermittently the page will load but fail to call it’s JavaScript initialization functions leaving the page only partially functional.

Put this code at the bottom of the master page file just before the closing body tag. PS :

<script type="text/javascript">
 * Code to handle the SharePoint / Chome bug

function chromeNudge() {
    /// <summary>
    /// If SharePoints body onload handler has not fired yet
    /// this function calls it manually
    /// </summary>
    if (!_spBodyOnLoadCalled) {
        if (window.console) {
            window.console.log('Chrome Bug: _spBodyOnLoadWrapper did not fire, calling manually.');

function chromeNudgeDelay() {
    /// <summary>
    /// If the current browser is Chrome, set a Timeout
    /// to call chromeNudge to at that time evaluate
    /// whether the onload wrapper needs a "nudge"
    /// </summary>
    if (navigator && navigator.userAgent && /chrome/.test(navigator.userAgent.toLowerCase())) {
        setTimeout(chromeNudge, 250);

// call chromeNudgeDelay after MS Ajax init event (aka body load)

share|improve this answer

To check whether javascript is working or not do the following

1) Insert a Script Editor in your web page. 2) Enter the following code inside the editor.

alert("javascript is working");
share|improve this answer
Right , its not popping :) – Nikhil Jangle Jun 27 '14 at 20:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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