I just spend a few hours analyzing why my Javascript/jQuery was not firing on my masterpage. Everything was good, I was down to using the simplest of code:
_spBodyOnLoadFunctions.push(function() { alert(“test”); });
No pop-up. It was in my source code. No script errors. Nothing. Silent. Dead.
Was there something wrong? Should I use document.ready ? Ofcourse not.
Once again, Elio Struyf came to the rescue. He asked me if the “Minimal Download Strategy” feature was enabled. Yes it was, I replied with a frown.
Apparantly, when you put scripts in your masterpage with the MDS feature enabled, things go horribly wrong. So, turn it off and see your javascript or jQuery running on the page!