remote

We offer some client-side Javascript functions prepackaged to coordinate with Connotea.

Showing Connotea Articles on Your Web Site

You can display Connotea articles on your web site by using our remote Javascript facility.

In the HTML <head> place the following HTML elements, replacing username with your Connotea username:

<script type="text/javascript" src="http://www.connotea.org/remote.js">//</script>
<script type="text/javascript" src="http://www.connotea.org/jsw/user/username">//</script>

And in the HTML <head> also place this style block or add the rules into an existing style block:

<style>
.connotea      { width: 350px; font-family: arial, helvetica, sans-serif }
.connotea_head { background-color: #eeeeee; padding: 4px 1px 4px 1px }
</style>

The CSS is available for your customization. Elements are also marked with CSS classes for items, item, info, tags, tag, etc.

In the HTML <body> place the following HTML element at the position where you would like a list of articles:

  <div id="connotea" class="connotea"></div>

The script in the head will arrange for an event to be called when the site is loaded that fills the div in the body with the articles.

Instead of /user/username in the second script element above, you can use other queries that yield articles, such as /tag/tagname or /user/username/tag/tagname.

Placing "Add To Connotea" Links on Your Web Site

You can include "Add To Connotea" hyperlinks on your web site by using our remote Javascript facility.

In the HTML <head> place the following HTML element:

<script type="text/javascript" src="http://www.connotea.org/remote.js">//</script>

In the HTML <body> place hyperlinks such as the following where you like:

<a href="javascript:addToConnotea()">Add To Connotea</a>

The addToConnotea() Javascript function can also be used in onclick handlers. It optionally accepts a URL parameter, which will default to the current browser location, and a custom title parameter, which if left undefined will be set server-side to the HTML title of the added URL.