简体   繁体   English

添加到日历链接不起作用

[英]Add to Calender link not working

I'm trying to put a 'Add to Calender' link on my website but it doesn't seem to be working only on my website. 我正在尝试在我的网站上放置“添加到日历”链接,但它似乎仅在我的网站上不起作用。 Here is the link: https://www.cvrc.virginia.edu/content/test You can see if shows up as a link and when you click it it doesn't have an add to option. 这是链接: https : //www.cvrc.virginia.edu/content/test您可以查看是否显示为链接,并且当您单击它时没有添加选项。 Here is the code I used. 这是我使用的代码。 If you open it up as a .html file on your computer it works fine. 如果您在计算机上将其作为.html文件打开,则可以正常工作。 Any ideas? 有任何想法吗?

<!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>

On your page, the link actually links to "example.com" -- 在您的页面上,该链接实际上链接到“ example.com”-

I imagine that your plug-in script is supposed to handle that, entirely - 我认为您的插件脚本应该可以完全处理该问题-

So, you should put the script after the <a> - because if the script refers to things that don't exist in the DOM, yet - then it simply won't work. 所以,你应该在以后把脚本<a> -因为如果脚本是指事情,不要在DOM存在,但-那是行不通的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM