Previous Topic

Next Topic

Book Contents

Book Index

Display calendar in an IFRAME

Here is a sample snippet for doing an IFRAME that includes a complete calendar.

<IFRAME scrolling="auto" width=800 height=1024
ID="calendarframe"
src="http://www.mhsoftware.com/caldemo/ViewCal.html">
Your browser doesn't support frames.
<A HREF="http://www.mhsoftware.com/caldemo/ViewCal.html">
Click here to see the calendar.
</A>
</IFRAME>

There's a script available that can auto-size your IFRAME to fit the calendar content automatically. You can download the script from:

http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

If you are using the hosted version of the calendar, you must perform these additional steps to make things work correctly.

  1. You MUST use a CNAME entry in your domain for the calendar URL. In other words if your web page is on www.yourdomain.com, you MUST have your calendar URL in the IFRAME be calendar.yourdomain.com.
  2. In the script, change the line:

    var iframeids=["myframe"]

    to read

    var iframeids=["calendarframe"]
  3. Add this snippet of script to the custom header or footer for your calendar AND to YOUR page containing the IFRAME:

    <SCRIPT TYPE="text/javascript">
    document.domain="yourdomain.com";
    </SCRIPT>

Replace "yourdomain.com" with the name of your domain. The idea here is that by setting the document domain to the same value for the page containing the IFRAME, and the calendar page, the JavaScript security checks will permit the script to manipulate the pages.

3. Copy and paste the example IFRAME code from the Script documentation into your web page. Change the SRC= portion to be http://calendar.yourdomain.com/

Tip

If you use an IFRAME, you'll want to turn off any custom headers and footers by deleting the Default Header and Default Footer entries from the SYSTEM | CONFIGURATION | APPEARANCE screen.

See Also: Calendar Display Arguments

See Also

IFrame Integration

IFrame Widgets