I am trying to get a modal to appear when the site loads.
- I created a site page called Disclaimer.aspx and stored it in the Site Pages document library.
- I created a text document called popup.txt and stored it in my Shared Documents.
- I added a content editor webpart to my home screen and linked it to the popup.txt file
Onload the page displays the modal however, the Disclaimer.aspx page isn't showing. I am getting a Error: An unexpected error has occurred
Contents of popup.txt:
<SharePoint:ScriptLink ID="ScriptLink21" Name="sp.js" runat="server" OnDemand="true"
Localizable="false" />
<script type="text/ecmascript">
ExecuteOrDelayUntilScriptLoaded(ShowDialog, "sp.js");
function ShowDialog() {
var options = {
url: '../SitePages/Disclaimer.aspx',
height: 500,
};
SP.UI.ModalDialog.showModalDialog(options);
}
</script>
I tried the code with the full path and I get the same error.