Embed Web Part - code for Forecast.io

New Contributor

Last week I noticed that the embed code for Forecast.io stopped working on my SharePoint site.  


<iframe height="200" width="100%" src="https://forecast.io/embed/#lat=36.7783&lon=-119.4179&name=California"/>


Forcast.io is returned in the Embed Web Part, but the pages says "Invalid Location"... almost like the full URL is not being called.  Do you have any thoughts on what might be causing this?

4 Replies

Hi @jsgraves,


Embed web part encodes the Url for iframe, and in page source code it looks like this: https://forecast.io/embed/#lat%3D36.7783%26lon%3D-119.4179%26name%3DCalifornia

And that is not working when copied to browser. 

I think it has something to do with # character in the url, because if I remove that url is not encoded. Not solving your issue because target site is returning 404 after. 



I have tried the same on my tenant and facing the same issue. I followed below article for embedding forecast.io to SharePoint:

Embedding Forecast.io Weather Into a SharePoint Page 


As @Matti Paukkonen said, SharePoint is encoding the src attribute of iframe element that might be causing this issue.


Workaround: I managed to show the forecast by using Modern Script Editor web part developed by community members and available through below links. You can add your iframe code in modern script editor and it will show the forecast automatically.

  1. Modern CEWP by SPJS 
  2. react-script-editor 

Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.


@Matti Paukkonen Thank you for the feedback.  I'm really not sure what happened, because it was working just fine up until about a week ago.  

@ganeshsanap Thanks so much for this feedback.  I'll have my system administrator take a look at the community web part.