Skip to content

For Webmasters

We have developed an interface for our Orthodox Calendar based on AJAX technology. You can read more about AJAX at the W3Schools website. We will show you how to set up Orthodox Calendar on your website step by step, starting from simple JavaScript examples and going into a more complex integration of the JavaScript calendar. You can read more about JavaScript at the W3Schools website.

The general idea is that JavaScript loadCalendar2.js, which uses XMLHttpRequest object calls simple proxy PHP script ppp.php. Proxy PHP script reads parameters from loadCalendar2.js and calls our calendar.php script. Then loadCalendar2.js returns Orthodox Calendar's HTML code into ElementById T1. We need proxy PHP script because XMLHttpRequest does not work across domains.

Download and unizip Example's directory zip file. To set up Orthodox Calendar first you need to copy loadCalendar2.js, ppp.php and one of Style Sheets (calendar_style_cherry.css, calendar_style_blue.css or calendar_style_gray.css) into your web server. Check our Example directory.

Let's see how it works in Example 1.1 You can check HTML code for each example by viewing page source in the browser.

Example 1.1 shows today's Lives of Saints, Scripture Reading and Troparion. Put a reference to JavaScript loadCalendar2.js somewhere in the header section of HTML:

<script type="text/javascript" src="loadCalendar2.js"></script>

Then put a reference to Style Sheets:

<link rel="stylesheet" type="text/css" href="calendar_style_cherry.css" />

<div id="T1"></div> - this is were our JavaScript returns HTML code.

Finally, here is small JavaScript to call the calendar script from our website:

<script type="text/Javascript">
var today=new Date();       // Get today's date
var mm=today.getMonth()+1;  // Get today's month
var dd=today.getDate();     // Get today's day
var yy=today.getFullYear(); // Get today's year
var dt=1;                   // Output date
var hh=1;                   // Output header
var ll=1;                   // Output Lives of Saints
var tt=1;                   // Output Troparion
var ss=1;                   // Output Daily Scripture Reading 

loadCalendar2(mm,dd,yy,dt,hh,ll,tt,ss);
</script>

That's it!

In Appendix A you can find a full description of parameters of loadCalendar2 function. Appendix B has description of Style Sheets. You can find and try different Orthodox Calendar views in this example.


With questions, comments, and technical support please write to us: