Forum Discussion
Call reload button programatically
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?
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>
- Taco888May 15, 2020Copper Contributor
Thanks. I tried as you recommended but it did not work.
The same error was shown.
And when I tried to call parent window method like:
window.parent.window.location.reload()it gave meUncaught (in promise) DOMException: Blocked a frame with origin "https://xxx.com" from accessing a cross-origin frame.- Nikitha-MSFTMay 18, 2020Former Employee
Taco888 - Are you able to reload the page locally?
- Taco888May 18, 2020Copper Contributor
When I open Dev tool and enter "location.reload()" on the console pane, it works.
And if the page is loaded on browser other than Teams, it works programatically.
But the same thing does not work on Teams programatically.