Using Javascript/JSONP

The Universalis server provides some of its content in JSONP format. This allows you to create a web page which contains the Mass readings for either today or next Sunday.

The way JSONP works is this:

  1. In your web page, you mark where you want the various parts of the Mass readings to go.
  2. In your web page, you include a Javascript function which we provide. This receives the data from our server and puts text in the appropriate parts of your page.
  3. When the user visits your page, his browser ends up displaying the data from our server.

The example page

Here is an example of a page which incorporates Universalis content. It is on a separate site from Universalis because your own web pages will be on a separate site from Universalis, and we want to show you that the mechanism works even in that case.

Creating your own page

Once you have looked at our example page, read this technical document to see how you can do the same thing on your site. Don't worry about having to learn Javascript if you haven't used it before. The instructions are straightforward and it is only a matter of copying and pasting.

However, you do need to have a way of writing the HTML code of your page directly. All HTML editors let you do this, but you may run into trouble if you are using something like Wordpress because (depending on its settings) it can restrict the tags you are allowed to use.