1

I am trying to add a weather forecast to my sharepoint homepage and but it will not work. I am using sharepoint online and a modern page. I am trying to add the code below with the "Embed" app.

<iframe id="forecast_embed" type="text/html" frameborder="0" height="245" width="100%" src="https://forecast.io/embed/#lat=38.738123&lon=-104.883909&name=C5 in Charlotte, NC”></iframe>
  • Are you getting any error while adding this code? – Ganesh Sanap Apr 19 at 3:21
0

Could be as simple as a bad quote symbol...

, NC”

, NC"

You will need to add forecast.io to "HTML Field Security" list.

0

There are two tings you need to do:

  1. Make sure the HTML for the iframe is valid.

Instead of this:

<iframe id="forecast_embed" type="text/html" frameborder="0" height="245" width="100%" src="https://forecast.io/embed/#lat=38.738123&lon=-104.883909&name=C5 in Charlotte, NC”></iframe>

you need this:

<iframe id="forecast_embed" type="text/html" frameborder="0" height="245" width="100%" src="https://forecast.io/embed/#lat=38.738123&lon=-104.883909&name=C5 in Charlotte, NC"></iframe>

Note that ” is replaced with "

  1. You need to allow forecast.io domain to be used in iFrames in your Site settings.

enter image description here

enter image description here

If this does not work and the Embeded webpart still complais about the domain - use "Allow contributors to insert iframes from any domain" option:

enter image description here

After you are done it should work just fine:

enter image description here

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.