Journey Planner Widget Headers

Hi, I’ve had a ticket to fix the tfl widget on a website. Upon further inspection I found this error: Refused to display 'https://tfl.gov.uk/Widgets/JourneyPlanner?to=...' in a frame because it set 'X-Frame-Options' to 'sameorigin'. I since tried to generate a new version through https://tfl.gov.uk/forms/12395.aspx but got given the same code back and no fix.

Any chance you could post up a screengrab of the error in the context of the frame?

Are you just using a straight iframe generation in your HTML output or generating it using javascript script? I can think of three ways of doing in javascript both of which might be problematic.

Brian

Hi @briantist I’m using the provided script from the tfl form.
<script>(function(w){w.to='...';w.url='https://tfl.gov.uk'; return w; })(window.tfl = window.tfl || {});</script><script src='https://tfl.gov.uk/cdn/static/scripts/specific/widgets/jp-widget.js'></script>

This is from the site with chrome inspector open.