4

I have some small HTML files (containing interactive data visualizations made in R/Python). They can't be published online but I thought I could upload them to Sharepoint/Teams and preview them in the HTML File Viewer to share with my colleagues.

Unfortunately, none of the files can be previewed as the JavaScript does not run. Is this the intended behavior of html file preview in Teams and Sharepoint?

As an example, the HTML file below produces the following preview in both Teams and Sharepoint.

Is there a way to default this file to Open in Browser rather than preview? or make it so the JavaScript does run?

<!DOCTYPE html>
<html>
<body>

<p id="demo">Javascript is not working</p>

<script>
  document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>

</body>
</html>

enter image description here

Ray Larone
  • 308
  • 4
  • 18
  • Can you please help us to understand ,Is the HTML pages iframable ? – VaraPrasad-MSFT Oct 05 '20 at 09:33
  • @VaraPrasad-MSFT Above is the `.html` file. Is this iframeable? I don't know. All I wan't to do is upload a `.html` file to Sharepoint to share with my colleagues without them having to download the file to their desktop and opening locally in a browser. I would have thought Sharepoint would support something like this as `.html` files are hardly obscure. – Ray Larone Oct 05 '20 at 15:45
  • 1
    For your page to display in Teams, you must include the [Microsoft Teams JavaScript client SDK](/javascript/api/overview/msteams-client?view=msteams-client-js-latestadd &preserve-view=true) and include a call to microsoftTeams.initialize() after your page loads. That is how your page and the Teams client communicate.see [here](https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/create-tab-pages/content-page) for more info – VaraPrasad-MSFT Nov 23 '20 at 23:12

0 Answers0