In this case, it’s probably because you are using the wrong brackets here:
document.getElementById['calendar'].src = loc;
should be
document.getElementById('calendar').src = loc;
More Related Contents:
- Invoking JavaScript code in an iframe from the parent page
- Adjust width and height of iframe to fit with content in it
- Access iframe elements in JavaScript
- Reload an iframe with jQuery
- Scrolling an iframe with JavaScript?
- Adding click event handler to iframe
- Pass value to iframe from a window
- How to embed an autoplaying YouTube video in an iframe?
- “Access is denied” JavaScript error when trying to access the document object of a programmatically-created (IE-only)
- Unsafe JavaScript attempt to access frame with URL
- Setting focus to iframe contents
- How to change style of iframe content cross-domain?
- Set content of iframe
- putting html inside an iframe (using javascript)
- How can I access the DOM elements within an iFrame
- how to block website from loading in iframe?
- Can I apply CSS to the elements within an iframe?
- Is it possible to add Request Headers to an iframe src request?
- Is there a way to uniquely identify an iframe that the content script runs in for my Chrome extension?
- Check if parent window is iframe or not
- Accessing an element outside of iframe
- Iframe.readyState does not work in chrome
- iFrame onload JavaScript event
- Trigger a button click inside an iframe [duplicate]
- How to limit display of iframe from an external site to specific domains only
- Accessing iframe from chrome extension
- Google DFP – Resize SafeFrame custom creative outer Iframe container from inside (expand ad)
- What’s the best way to set cursor/caret position?
- Chrome userscript error: “Unsafe JavaScript attempt to access frame”
- JQuery Modal Boxes and Iframe