I am working with SharePoint hosted apps, and I require to display the default SharePoint version history page of a list item in a modal dialog popup.
(url/_layouts/15/Versions.aspx?list={"+listId+"}&ID="+itemId). However I get "This page cannot be display" as in the screenshot.
This is the piece of code I used.
var hostweburl = decodeURIComponent(manageQueryStringParameter('SPHostUrl'));
var listId = 'F7C3D94A-9762-47C6-8A9C-024922982574';
var itemId = 100;
var versionURL = hostweburl + "/_layouts/15/Versions.aspx?list={" + listId + "}&ID=" + itemId;
ExecuteOrDelayUntilScriptLoaded(openVersionHistory, "SP.js");
function openVersionHistory() {
var options = {
title: 'Version History',
url: versionURL,
width: 500,
height: 500
}
SP.UI.ModalDialog.showModalDialog(options);
return false;
}