0

I tried doing the following in Visualforce Page:

<apex: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>
</apex:page>

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?

0

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" 
    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>

(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 Nov 20 '18 at 15:57
  • @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 Nov 20 '18 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.