I am implementing the javascript widget found on addtocalendar.com. Their code example is posted below. Everything works when I place it on a page normally. However I want the calendar widget button to show up on a dynamic table returned from ajax (Step 3 in the sample code). When I do that it breaks. The calendar button does not show up in the rows of a dynamic table (which is what I need).
What change do I need to make to the sample code such that the calendar widget button will show up on a dynamic created table returned from ajax?
I do not get an error in the console. The button simply does not show up.
<html>
<head>
<!-- 1. Include style -->
<link href="http://addtocalendar.com/atc/1.5/atc-style-blue.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- 2. Include script -->
<script type="text/javascript">(function () {
if (window.addtocalendar)if(typeof window.addtocalendar.start == "function")return;
if (window.ifaddtocalendar == undefined) { window.ifaddtocalendar = 1;
var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
s.type = 'text/javascript';s.charset = 'UTF-8';s.async = true;
s.src = ('https:' == window.location.protocol ? 'https' : 'http')+'://addtocalendar.com/atc/1.5/atc.min.js';
var h = d[g]('body')[0];h.appendChild(s); }})();
</script>
<!-- 3. Place event data -->
<span class="addtocalendar atc-style-blue">
<var class="atc_event">
<var class="atc_date_start">2015-05-04 12:00:00</var>
<var class="atc_date_end">2015-05-04 18:00:00</var>
<var class="atc_timezone">Europe/London</var>
<var class="atc_title">Star Wars Day Party</var>
<var class="atc_description">May the force be with you</var>
<var class="atc_location">Tatooine</var>
<var class="atc_organizer">Luke Skywalker</var>
<var class="atc_organizer_email">luke@starwars.com</var>
</var>
</span>