Register for priority notice of the next AJAX application.

The following code allows you to provide a link on your website so that people can launch any of your songs using ajaxTunes.

1. Include the ajaxTunes.js file in your HTML page like so:

<script language="JavaScript" type="text/javascript" src="http://www.michaelrobertson.com/ajaxtunes/ajaxTunes.js"></script>

This file declares 4 useful functions:

ajaxTunesLoadSong('song_title', 'song_url')
ajaxTunesLoadPlaylist('playlist_url')
ajaxTunesDemo()
ajaxTunesLogin('username','password')


2. Sample HTML links:

a. Play a single MP3 file:

<a href="javascript:ajaxTunesLoadSong('Sia - Breathe Me','http://audio.sxsw.com/2006/mp3/Sia-Breathe_Me.mp3');" class="slignore">Listen to it now</a>
<a href="javascript:ajaxTunesLoadSong('Clap Your Hands Say Yeah - Upon This Tidal Wave Of Young Blood','http://clapyourhandssayyeah.com/mp3/Tidal_Wave.mp3');" class="slignore">Listen to it now</a>
<a href="javascript:ajaxTunesLoadSong('Jason Collett - We All Lose One Another','http://audio.sxsw.com/2006/mp3/Jason_Collett-We_All_Lose_One_Another.mp3');" class="slignore">Listen to it now</a>

b. Play an XSPF (http://www.xspf.org/quickstart/) playlist:

<a href="javascript:ajaxTunesLoadPlaylist('http://www.mp3tunes.com/ajaxTunes.xspf');" class="slignore">Play Playlist</a>

c. Demo ajaxTunes Locker:

<a href="javascript:ajaxTunesDemo();">Demo</a>

d. Login to your MP3tunes Account:

<a href="javascript:ajaxTunesLogin('demo@mp3tunes.com','demo');">Login</a>