Search code examples
jqueryhtmliframeembedslack

Embed slack on a html page


I am having trouble embedding a slack feed onto a html site. When I try to use an iframe, it just shows up as a white box. I have tried using jquery

<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> .       
    </script>
    <script>
$("#testLoad").load("http://www.SlackURLHere");
    </script>
  </head>
  <body>

    <div id="testLoad"></div>

    <iframe src="http://www.SlackURLHere"></iframe>
  </body>
</html>

I have tried with "http" and "https" on both iframe and jquery with no luck. :( So if you have any other methods please do share!

Thanks


Solution

  • Just tried this and it looks like the reason it won't display is because of the X-Frame-Options header which is set by slack.com to be SAMEORIGIN. In other words, you're only allowed to embed that page when on slack.com, not anywhere else.