Sharepoint - ExecuteOrDelayUntilScriptLoaded with sp.js when in debug mode Object Expected
You are using ExecuteOrDelayUntilScriptLoaded wrong, you should use the function name, not execute it.
Like this:
jQuery(document).ready(function() {
ExecuteOrDelayUntilScriptLoaded(myfunction, "sp.js");
});
Note that i removed the "()" from myfunction. Now it should work as expected