Skip to main content
added 1473 characters in body
Source Link
Lee
  • 4.3k
  • 1
  • 8
  • 7

Update:

<div id="modifiedDate"></div>
    <div id="ModifiedBy"></div>
    <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        function getModifiedDate() {
            var listId = _spPageContextInfo.pageListId.replace('{', '').replace('}', '');
            var itemId = _spPageContextInfo.pageItemId;
            $.ajax({
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists(guid'" + listId + "')/items?$select=Modified,Editor/FirstName&$expand=Editor&$filter=ID eq " + itemId,
                method: "GET",
                headers: {                    
                    "Accept": "application/json;odata=verbose",
                    "X-RequestDigest": $("#__REQUESTDIGEST").val(),                    
                },
                success: function (data) {                    
                    $("#modifiedDate").html("Page Modified on: " + data.d.results[0].Modified);
                    $("#ModifiedBy").html("Page Modified by: " + data.d.results[0].Editor.FirstName);
                },
                error: function (data) {
                    console.log(data);
                }
            });
        }

        $(document).ready(function () {
            getModifiedDate();
        });
    </script>

Update:

<div id="modifiedDate"></div>
    <div id="ModifiedBy"></div>
    <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        function getModifiedDate() {
            var listId = _spPageContextInfo.pageListId.replace('{', '').replace('}', '');
            var itemId = _spPageContextInfo.pageItemId;
            $.ajax({
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists(guid'" + listId + "')/items?$select=Modified,Editor/FirstName&$expand=Editor&$filter=ID eq " + itemId,
                method: "GET",
                headers: {                    
                    "Accept": "application/json;odata=verbose",
                    "X-RequestDigest": $("#__REQUESTDIGEST").val(),                    
                },
                success: function (data) {                    
                    $("#modifiedDate").html("Page Modified on: " + data.d.results[0].Modified);
                    $("#ModifiedBy").html("Page Modified by: " + data.d.results[0].Editor.FirstName);
                },
                error: function (data) {
                    console.log(data);
                }
            });
        }

        $(document).ready(function () {
            getModifiedDate();
        });
    </script>
Source Link
Lee
  • 4.3k
  • 1
  • 8
  • 7

You may inject these information by Rest api and jQuery, sample script:

<div id="modifiedDate"></div>
    <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        function getModifiedDate() {
            var listId = _spPageContextInfo.pageListId.replace('{', '').replace('}', '');
            var itemId = _spPageContextInfo.pageItemId;
            $.ajax({
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists(guid'" + listId + "')/items?$select=Modified&$filter=ID eq " + itemId,
                method: "GET",
                headers: {                    
                    "Accept": "application/json;odata=verbose",
                    "X-RequestDigest": $("#__REQUESTDIGEST").val(),                    
                },
                success: function (data) {                    
                    $("#modifiedDate").html("Page Modified on: " + data.d.results[0].Modified);
                },
                error: function (data) {
                    console.log(data);
                }
            });
        }

        $(document).ready(function () {
            getModifiedDate();
        });
    </script>