Daily Prayers Web Site Widget Example

From the liturgical calendar web page.

This uses the div-type code, basic settings, but with a style attribute added to make it float right.

    <div id="dailyPrayerWidget" style="float:right"></div>

The float-style is usually a desired quality for things like this.

If you use the <span>-style, it will appear like the text at the top of every page at The Rosary Shop.

The widget inherits the style information from your web page for fonts, sizes, etc. You can add any style settings you want, but it will set its own width, border, margin, padding and background color unless you add data-DBstyle="manual" in the opening div. You'll then need to specify those style attributes, or the div will automatically expand to fill whatever space it is in, run up against neighboring text, and generally misbehave.

The widget does not attempt to set any style information for <span>s, only <div>s.

If you look at the source code for this web page, you'll see that the script that loads the java library is in the head of the page, but you could put it anywhere you want. Its location in the page does not matter, because it doesn't actually load anything until the rest of your web page has loaded, thereby preventing any delays on your web content presentation.

All that fancy javascript code is doing is adding a short javascript library to you page that handles the filling of the widget. It is just doing it in a way to minimize impact on your web site. If you want to simplify your life, you could just include the following in its place:

    <script language="JavaScript" src='http://www.rosaryshop.com/dailyPrayer.js'></script>

Here is the HTML for this web page (so you can easily inspect it):