添加到日历链接不起作用

时间:2014-01-21 14:27:17

标签: javascript php html drupal calendar

我正在尝试在我的网站上添加“添加到日历”链接,但它似乎只在我的网站上有效。这是链接:https://www.cvrc.virginia.edu/content/test 您可以看到是否显示为链接,当您单击它时,它没有添加到选项。这是我使用的代码。如果您在计算机上将其打开为.html文件,它可以正常工作。有什么想法吗?

<!DOCTYPE html>
<html> 
 <head>
  <title>AddThisEvent</title>
  <meta name="Description" content="" />
  <meta name="Keywords" content="" />
  <meta name="Author" content="Michael Nilsson, AddThisEvent" />

  <meta charset="utf-8" />

  <!-- AddThisEvent -->
  <script type="text/javascript" src="http://js.addthisevent.com/atemay.js"></script>
<!-- AddThisEvent Settings -->
<script type="text/javascript">
addthisevent.settings({
    license   : "aao8iuet5zp9iqw5sm9z",
    mouse     : false,
    css       : true,
    outlook   : {show:true, text:"Outlook Calendar"},
    google    : {show:true, text:"Google Calendar"},
    yahoo     : {show:true, text:"Yahoo Calendar"},
    hotmail   : {show:true, text:"Hotmail Calendar"},
    ical      : {show:true, text:"iCal Calendar"},
    facebook  : {show:true, text:"Facebook Event"},
    callback  : ""
});
</script>
 </head>
<body>

<!-- Snippet -->
<a href="http://example.com/link-to-your-event" title="Add to Calendar" class="addthisevent">
    Add to Calendar
    <span class="_start">10-05-2012 11:38:46</span>
    <span class="_end">11-05-2012 11:38:46</span>
    <span class="_zonecode">40</span>
    <span class="_summary">Summary of the event</span>
    <span class="_description">Description of the event</span>
    <span class="_location">Location of the event</span>
    <span class="_organizer">Organizer</span>
    <span class="_organizer_email">Organizer e-mail</span>
    <span class="_all_day_event">false</span>
    <span class="_date_format">DD/MM/YYYY</span>
</a>

</body>
</html>

1 个答案:

答案 0 :(得分:1)

在您的网页上,该链接实际上链接到“example.com” -

我想你的插件脚本应该完全处理它 -

所以,你应该将脚本放在 <a>之后 - 因为如果脚本引用了DOM中不存在的东西 - 那么它根本就不起作用。