Forum Discussion

Lindsey's avatar
Lindsey
Leader
6 years ago

Script tag in blog HTML getting incorrectly encoded

I am trying to make a blog article with embedded Wistia videos. These require script tags. When I add the script tags to the HTML of the blog article, they get changed to &lt script &gt and aren't read by the page. 
First question - how do I get the blog article to stop encoding script tags and read it as html like it does for other tags?
Second question - is this even possible to put external javascript tags in blog articles? Will it even work if I get it to stop encoding it?

  • I encountered this problem too, and found a Wistia embed code that didn’t require JavaScript. I’m on my phone right now and can’t find it, but I’ll post here this eve with more details on the code I used!

    • CarolineS's avatar
      CarolineS
      Boss

      Here's a sample of the Wistia code I have used successfully in blog posts on my community. It does have an iframe, but no <script>

       

      <div class="wistia_responsive_padding" style="padding: 56.56% 0 0 0; position: relative;">
      <div class="wistia_responsive_wrapper" style="height: 100%; left: 0; position: absolute; top: 0; width: 100%;"><iframe src="<a href="https://fast.wistia.net/embed/iframe/XXXXXXX?videoFoam=true" target="_blank">https://fast.wistia.net/embed/iframe/XXXXXXX?videoFoam=true</a>" width="100%" height="100%" name="wistia_embed" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" title="Wistia video player" allowtransparency="true" class="wistia_embed" mozallowfullscreen="mozallowfullscreen" oallowfullscreen="" msallowfullscreen=""></iframe></div>
      </div>

       

       

      • CarolineS's avatar
        CarolineS
        Boss

        UGH, the code editor is messing with my pasted-in code and adding extra "<a href" around the URL of my iframe. Trying again... (this time telling the code editor that the code is in Java instead of in HTML...)

         

         

        <div class="wistia_responsive_padding" style="padding: 56.56% 0 0 0; position: relative;">
        <div class="wistia_responsive_wrapper" style="height: 100%; left: 0; position: absolute; top: 0; width: 100%;"><iframe src="<a href="<a href="https://fast.wistia.net/embed/iframe/XXXXX?videoFoam=true" target="_blank">https://fast.wistia.net/embed/iframe/XXXXX?videoFoam=true</a>" target="_blank"><a href="https://fast.wistia.net/embed/iframe/hkk16dfb9s?videoFoam=true</a" target="_blank">https://fast.wistia.net/embed/iframe/hkk16dfb9s?videoFoam=true</a</a>>" width="100%" height="100%" name="wistia_embed" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" title="Wistia video player" allowtransparency="true" class="wistia_embed" mozallowfullscreen="mozallowfullscreen" oallowfullscreen="" msallowfullscreen=""></iframe></div>
        </div>