[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

Creating markup for embedded Google Calendar using JavaScript

Hi Experts!

I am utilising Google Calendars within a clients website, at the moment by simply using the embedded iframe method.  Instead of using Googles customisation tool, I have created a javascript function to generate the iframe markup, because I want to embed different calendars at different points around the site, and do not want to have to keep using the Google Customisation Tool each time I want to make a change.  Eventually I will utilise the Calendar API, but when I have more time.

I have attached a standalone example.  The problem that I am having is that when the iframe element is inserted into the DOM, the entire page redirects to the Google Login page.  I do not understand why?  These are public calendars and should not require the user to be logged in.

I have tried inserting iframe HTML, inserting the iframe DOM element, and even setting the src attribute after the DOM element is inserted.  What gives?  I am obviously missing something here.. Any ideas?

TIA, TheFoot
Barry Jones
Barry Jones
  • 2
1 Solution
Albert Van HalenAnalyst developerCommented:
Replace & with & in the url you're constructing.
Barry JonesAuthor Commented:
Bloody hell!  Awesome - thanks a bunch.
Barry JonesAuthor Commented:

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now