JavaScript runtime error: 'NotifyScriptLoadedAndExecuteWaitingJobs' is undefined

Posted Monday, April 29, 2013 9:57 PM by CoreyRoth

I recently ran into the following error when working with a SharePoint 2013 Client Web Part (App Part) while accessing the term store using SP.Taxonomy.js

JavaScript runtime error: 'NotifyScriptLoadedAndExecuteWaitingJobs' is undefined.

SPTaxonomyErrorNotifyScriptLoadedAndExecuteWaitingJobs

The following line gets hit in the debugger.

SPTaxonomyErrorNotifyScriptLoadedAndExecuteWaitingJobs2

The code I had worked fine inside a page, but when placed inside a client web part, I received the error.  I thought it might be something to do with the order in how I loaded the script files.  I recently switched to the new Client Web Parts set up in the RTM version of the Office Developer Tools.  This particular update changes the references to the JavaScript files to the page instead of being loaded dynamically with $.GetScript().  It turns out it had nothing to do with that.  Instead, I just needed to add a reference to Init.js.  Here is what my complete list of references looks like in the page for my client web part.

<script type="text/javascript" src="../Scripts/jquery-1.7.1.min.js"></script>

<script type="text/javascript" src="/_layouts/15/MicrosoftAjax.js"></script>

<script type="text/javascript" src="/_layouts/15/init.js"></script>

<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>

<script type="text/javascript" src="/_layouts/15/sp.js"></script>

<script type="text/javascript" src="/_layouts/15/sp.taxonomy.js"></script>

If you receive the error above that is all you have to do..  Luckily, it’s easy to fix.

Comments

# JavaScript runtime error: 'NotifyScriptLoadedAn...

Tuesday, May 14, 2013 2:03 PM by JavaScript runtime error: 'NotifyScriptLoadedAn...

Pingback from  JavaScript runtime error: 'NotifyScriptLoadedAn...

# re: JavaScript runtime error: 'NotifyScriptLoadedAndExecuteWaitingJobs' is undefined

Thursday, September 5, 2013 6:40 AM by Neal

Thank you so much! This post just saved my day!

# re: JavaScript runtime error: 'NotifyScriptLoadedAndExecuteWaitingJobs' is undefined

Tuesday, February 25, 2014 2:53 AM by Fadi Nassri

Many Thanks Corey Roth

# re: JavaScript runtime error: 'NotifyScriptLoadedAndExecuteWaitingJobs' is undefined

Monday, June 16, 2014 12:05 PM by Jijo Joy

Thanks a lot. I missed the init.js

# re: JavaScript runtime error: 'NotifyScriptLoadedAndExecuteWaitingJobs' is undefined

Tuesday, September 23, 2014 1:56 AM by Monvi

it did'nt solve my issue..still getting the same error..

# How To Fix Java Runtime Error Is Undefined in Windows

Friday, January 9, 2015 5:20 AM by How To Fix Java Runtime Error Is Undefined in Windows

Pingback from  How To Fix Java Runtime Error Is Undefined in Windows

# re: JavaScript runtime error: 'NotifyScriptLoadedAndExecuteWaitingJobs' is undefined

Friday, May 22, 2015 9:12 AM by Leigh F

Thank you sooo much! great you identified the specific init.js file too... Saved me a lot of hours with this

Leave a Comment

(required) 
(required) 
(optional)
(required)