I tried doing the following in Visualforce Page:

    <div class="embed-container"><iframe src="https://fred.stlouisfed.org/graph/graph-landing.php?g=m8jU5" scrolling="no" frameborder="0" style="overflow:hidden; allowTransparency="true"></iframe></div><script src="https://fred.stlouisfed.org/graph/js/embed.js" type="text/javascript"></script>

but get the following error :

Error: ExternalChart line 2, column 182: Element type "iframe" must be followed by either attribute specifications, ">" or "/>" Error Error: Element type "iframe" must be followed by either attribute specifications, ">" or "/>".

I've tried converting the iframe code to apex:iframe but I still get the same error. How do I get this thing to work?

1 Answer 1


As shown by the Syntax Highlighting (which is really why you should be using an IDE or Developer Console), you missed a quotation mark.

<div class="embed-container">
  <iframe src="https://fred.stlouisfed.org/graph/graph-landing.php?g=m8jU5" 
<script src="https://fred.stlouisfed.org/graph/js/embed.js" type="text/javascript">

(Line breaks added for legibility).

The missing quote was here:

style="overflow:hidden; allowTransparency="true"
              Missing quote here
  • Weird I copied the "embed to website" code directly from the source website itself and copied it to a WYSIWYG html editor website to see if it worked - didn't think there'd be a missing quote.
    – compski
    Commented Nov 20, 2018 at 15:57
  • 1
    @compski That's understandable; browsers are a lot more lenient about "broken" code (it always "tries to do the right thing"). In Visualforce, you have to be more diligent about these technicalities. (PS you might want to tell the source website their code is flawed).
    – sfdcfox
    Commented Nov 20, 2018 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .