HTML block displays code on finished site

  • Unknown's avatar

    Hello,

    I’m hoping this is a stupid question! I copied some embed code from Tableau to display a data visualization I made. It’s showing up great… but so is all the html code under it. Did I turn this on? Is this something I need to turn off? Is it somehow in the embed code? I don’t read html so it’s totally possible it’s the html code telling it to display.

    Thank you!
    Shae Lynn

    The blog I need help with is: (visible only to logged in users)

  • Hey there,

    Some embed code will not work because we do not allow certain tags on WordPress.com, for security reasons, including JavaScript, Flash, iframe, form, and input tags.

    These restrictions are in place to prevent any disruptions in service due to potentially malicious code.

    You can read more about this here:

    Code

    Does the code you’re adding have any of those restricted tags?

    Let me know if you have any questions.

    Thanks!

  • Unknown's avatar

    Thanks for your reply! I’m really out of my depth here, I’m not sure what the difference is between a tag and just having the word in the code. The word ‘object’ appears, as does ‘style’.

    What I’m finding confusing is that the image appears exactly as I’m expecting it too, I just also see all the code below that.

    Here’s the code, if it’s helpful.

    <div class=”tableauPlaceholder” id=”viz1599580833573″ style=”position:relative;”> </div> var divElement = document.getElementById(‘viz1599580833573’); var vizElement = divElement.getElementsByTagName(‘object’)[0]; if ( divElement.offsetWidth > 800 ) { vizElement.style.minWidth=’420px’;vizElement.style.maxWidth=’650px’;vizElement.style.width=’100%’;vizElement.style.minHeight=’587px’;vizElement.style.maxHeight=’887px’;vizElement.style.height=(divElement.offsetWidth*0.75)+’px’;} else if ( divElement.offsetWidth > 500 ) { vizElement.style.minWidth=’420px’;vizElement.style.maxWidth=’650px’;vizElement.style.width=’100%’;vizElement.style.minHeight=’587px’;vizElement.style.maxHeight=’887px’;vizElement.style.height=(divElement.offsetWidth*0.75)+’px’;} else { vizElement.style.width=’100%’;vizElement.style.height=’977px’;} var scriptElement = document.createElement(‘script’); scriptElement.src = ‘https://public.tableau.com/javascripts/api/viz_v1.js’; vizElement.parentNode.insertBefore(scriptElement, vizElement);

  • OK, the code didn’t render properly here, but I can tell by looking at it that it has scripts, objects, and styles:

    The following tags are not allowed on sites on our Premium Plan and below for security reasons:

    embed, frame, iframe, form, input, object, textarea, style

    We don’t currently support tableau either, though I have noted your request.

    Here’s what I’d recommend. There’s an image of the chart. Upload that instead, then link to your tableau so folks can click through to access the interaction.

  • The topic ‘HTML block displays code on finished site’ is closed to new replies.