Foros‎ > ‎Sharepoint‎ > ‎

uncaught reference error: $ is not defined - Run after load

publicado a la‎(s)‎ 5 feb. 2015 5:48 por Ignacio Gonzalez
First it can be a conflict in jQuery. I always use "jQuery()" instead of "$()" with SharePoint

Other options:

1) Script on Demand: (load a js file then execute my code.)

function stuffThatRequiresSP_JS(){
    //your code


2) Delay until loaded (wait for a js file, then run)

function stuffToRunAfterSP_JS(){
    //your code
ExecuteOrDelayUntilScriptLoaded(stuffToRunAfterSP_JS, "sp.js")

3) load after other stuff finishes

function runAfterEverythingElse(){
    // your code