refreshPage() for Salesforce Classic

Usage 

Returns true if page refresh is invoked, false otherwise. When this method is called within the Salesforce console, it refreshes the current active tab. This method is only available in API version 28.0 or later.

Syntax 

1sforce.interaction.refreshPage(callback:function);

Arguments 

NameTypeDescription
callbackfunctionJavaScript method executed when the API method call is completed.

Sample Code–JavaScript 

1<html>
2<head>
3   <script type="text/javascript" src="http://domain:port/support/api/28.0/interaction.js"></script>
4   <script type="text/javascript">
5       var callback = function (response) {
6           if (response.result) {
7                  alert('Page refresh has been invoked.');
8            } else {
9                   alert('Page refresh has not been invoked.');
10           }
11        };
12       function refreshPage() {
13                sforce.interaction.refreshPage(callback);
14        }
15</script>
16</head>
17<body>
18       <button onclick="refreshPage();">refreshPage</button>
19</body>
20</html>

Response 

NameTypeDescription
resultbooleanReturns true if page refresh has been invoked, false otherwise.
errorstringIf the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.