Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8477819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:34:17+00:00 2026-06-10T18:34:17+00:00

I have a custom JS script which I load into SharePoint and have problems

  • 0

I have a custom JS script which I load into SharePoint and have problems to get my init method executed after SP is finished with its own initializing.

_spBodyOnLoadFunctionNames

I tried the “official” way first and added my function name to the list of executed functions after body load with _spBodyOnLoadFunctionNames.push("myInitMethod"); but that does not fire on every page load, I can’t rely on that.

ExecuteOrDelayUntilScriptLoaded

Then I tried to use ExecuteOrDelayUntilScriptLoaded(myInitMethod, "sp.js"); function but it does not fire on every page load either.

Both ways work – but not every time. I assume that my script is loaded sometimes before the SP is initialized. This happens mostly on Chrome but on IE as well.

How can I make sure that my script is executed when SP is ready?


Note: There is an interesting behaviour when the page is loaded and the SP object is not fully initialized (the registered functions in ExecuteOrDelayUntilScriptLoaded has not been called): As soon as I click on the “Navigate Up” anchor in the page (where you can see the hiarchy of the subsites) the following files gets loaded and my init function (registered in ExecuteOrDelayUntilScriptLoaded) gets called!

  • core.debug.js
  • sp.core.debug.js
  • ScriptResx.ashx
  • sp.ui.dialog.debug.js
  • sp.runtime.debug.js
  • sp.debug.js

So everything is fine after that click – but why not on pageload as it should be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:34:19+00:00Added an answer on June 10, 2026 at 6:34 pm

    It seems that this behaviour is related to some issues between SP 2010 and Google Chrome – I don’t have this issues on other browsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script in which I am trying to load a custom php.ini
I have an import script which runs a series of commands to get things
I have a custom build and deployment script which work over SSH and deploy
i have a custom joomla template which i load jquery in using the normal
I have a custom script step in my build process that zips the executable.
I have a custom accordion script that I'm trying to adapt for another site.
I have a custom accordion script - http://jsfiddle.net/nJpNb/2/ What I want to be able
I have a custom validator that points to a Client side script to validate
I have this code <html> <head> <script src=jquery-1.7.2.min.js type=text/javascript></script> <script src=jquery-ui-1.8.20.custom.min.js type=text/javascript></script> <script type
I have a js code in which an array works well when its like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.