Forum Discussion
Call reload button programatically
I'm creating a tab app on Teams.
I need to refresh contents but calling location.reload() does not work.
Is there any way to call reload tab button on right upper side programatically?
- Nikitha-MSFTMicrosoft
Taco888 - Currently teams does not provide reload tab button pragmatically. Could you please build your own reload within the tab.
- Taco888Copper Contributor
Thanks for your reply.
But when I call location.reload(), it gave me an error like:
Mixed Content: The page at 'https://teams.microsoft.com/iframe-container.html#iframeurl=https%3A%2F%2Fxxx.com%2F&skipDomainValidation=true' was loaded over HTTPS, but requested an insecure resource 'http://xxx.com/path/'. This request has been blocked; the content must be served over HTTPS.
* xxx.com is actually our domain.
I don't know why https is replaced to http.
Is there any way to reload the page?
- Nikitha-MSFTMicrosoft
Taco888 - Could you please try to use location.reload after initializing Microsoft teams. Could you please try this code
<! DOCTYPE html>
<html>
<body>
<input type="button" name="Button" value="Click" onclick="onClick()">
<script type="text/javascript">
microsoftTeams.initialize();
function onClick() {
location.reload();
}
</script>
</body>
</html>