I know I can do this:
ExecuteOrDelayUntilScriptLoaded(function()
{
SP.UI.ModalDialog.showModalDialog(..)
}, "sp.js");
But I want to call SP.UI.ModalDialog.showModalDialog
as soon as the page loads, without waiting for ExecuteOrDelayUntilScriptLoaded
.
I saw SharePoint 2010 Modal Dialog on Page Load but that says to use ExecuteOrDelayUntilScriptLoaded
.
I tried referencing the required JS files but then I get an error `Object doesn't support property or method 'get_staticObjects'.
<script type="text/javascript" src="/_layouts/init.js"></script>
<script type="text/javascript" src="/_layouts/sp.core.js"></script>
<script type="text/javascript" src="/_layouts/sp.js"></script>
<script type="text/javascript" src="/_layouts/SP.UI.Dialog.js"></script>