Adding TFL (Transport for London) Journey Planner to Blog?

  • Unknown's avatar

    Hi guys,

    I hope someone can help me. I’m a bit lost.

    I’m setting up the nascent website for my company. I need to add the Transport for London (tfl) journey planner.

    The TFL website says, “Copy the code in the box below and paste it into your web page”. This is the code:

    <script>(function(w){w.to=’Harmondsworth+IRC’;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>

    However, when I paste this code, it won’t work at all!

    Currently the website is on wordpress.com, and that is where I would like to keep it; I hope a move to wordpress.org isn’t necessary.

    I hope you can help me!

    Kind regards,

    Bryan

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar
  • Unknown's avatar

    Hi thesacredpath,

    Thank you very much for your answer. Is there any way of editing that code so that it works on wordpress?

    Kind regards,

    Bryan

  • Unknown's avatar

    No, there isn’t. You can check with the source of the code and see if they have any that is HTML only. If they do, look at it, and if you see “iframe” we would be out of luck with that too, since iframes are not allowed here either.

  • Unknown's avatar

    Hi there, thesacredpath.

    I’m a bit of a noob, so would you be able to tell me how I might be able to “check with the source of the code”?

    I hope you can help!

    Bryan

  • Bryan,

    What @thesacredpath meant was to check with the TFL if they provide an HTML-only embed code for the Journey Planner.

    The code they gave you (which you posted above) includes JavaScript, which is not allowed here. If they don’t provide any other code, I’m afraid using the planner won’t be possible here on WordPress.com blogs.

  • Unknown's avatar

    Hi ehtis,

    Many thanks for the clarification. I have emailed TFL to get clarification on that, but they haven’t responded yet. Hopefully they can get back to me “soon”.

    Many thanks indeed for your help.

  • Not a problem! :)

    If it doesn’t work out, consider adding a Google Map to your blog.

    I see in your other thread that you wanted the Journey Planner to target your office—you can set Google Map to center over an address, and I think it shows a button for directions as well. Test it out, might work as an alternative.

  • The topic ‘Adding TFL (Transport for London) Journey Planner to Blog?’ is closed to new replies.