I have a javascript file saved in my site assets that i can get to run (I ran an alert box to test), but I can't get the function inside of it to run.
Here is the code for the button...
<button class="lg-button lg-button-text" id="testbutton" type="button" onclick="javascript:dialogfunction('https://asml.sharepoint.com/teams/HBO_EUV_AP_Tracker/SitePages/Help%20Center%20WPP.aspx')">
<img class="excel-icon" alt="excel" src="/teams/HBO_EUV_AP_Tracker/SiteAssets/excel-logo.png" />
<p class="lg-button-text">Create<br> Scanner AP</p>
</button>
Sharepoint designer immediately deletes the onclick code above ^ when I try to save it.
Here is the code in the javascript file...
function dialogfunction(pageUrl) {
var options = {
url: pageUrl,
width: 1100,
height: 600,
};
SP.UI.ModalDialog.showModalDialog(options);
}
So I know it's connected correctly. I used a content editor and linked to the javascript page, and i know the modal box usually works because I had it working with an image when it was all in a script editor. But I'm not sure how to get it to bring up the modal box when I have the function in a javascript file.
I tried to load the javascript file after everything else, but that didn't do me any good eiher.
Can someone help! I have searched everywhere.