Isaac
asked on
JS error: 'function' is undefined
I have a sharepoint web part page with a CEWP in it containing the code below but I get the following error and can't figure out why.
SCRIPT5009: 'OpenPopup' is undefined
Here's the page: http://isaac.issharepoint.com/ICTT/Shared%20Documents/dataTables.aspx
Any idea why?
I have the below inside of a CEWP on a webpart page in SP 2013
SCRIPT5009: 'OpenPopup' is undefined
Here's the page: http://isaac.issharepoint.com/ICTT/Shared%20Documents/dataTables.aspx
Any idea why?
I have the below inside of a CEWP on a webpart page in SP 2013
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text\javascript">
function OpenPopup() {
var url = "/modalTable.aspx";
var options = {
url: url,
title: 'Modal Example',
allowMaximize: false,
showClose: true,
width: 600,
height: 500,
dialogReturnValueCallback: refreshCallback
}
SP.UI.ModalDialog.showModalDialog(options);
}
function refreshCallback()
{
alert("HELLO WORLD");
}
</script>
</head>
<body>
<span>Click to open datatable in modal box</span>
<input type="button" value="Modal Box" onclick="OpenPopup();" />
</body>
</html>
ASKER
'MoveSiteTitle' is not something I created or am calling. That's a SharePoint 2010 thing. The only error that I'm getting is SCRIPT5009: 'OpenPopup' is undefined
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found a solution that worked.
I think on the page load it is calling "MoveSiteTitle" function, which is not present on the page.
You need to add the definition of "MoveSiteTitle" function to the page.
Please refer attached screenshot.
Regards,
Ronak
error.png