Example 8
This example shows you how to handle external links via javascript.

In this example, the "alert" dialog pops up when you click on the cover art image. The data contained in the <comments> section is directed to javascript, and the handleLinkClick function within wimpy.js is prompting the alert dialog with the data contained in the <comments> section of playlist1.xml.

 

>> Click the cover art graphic in the player below <<

 

You need to upgrade your Flash Player

 

 

Source Code

<script language='javascript' src='wimpy.js'></script>
<div id="wimpyTarget">This DIV content will be replaced by Wimpy.</div>
<script language="JavaScript" >

// Set default configs.

// "enableWimpyEvents" must be set to true, otherwise, events are not returned.
enableWimpyEvents = true;

// "ecomWindow" must be set to "javascript" in order for links to be handled by the javascript link handler.

defaultWimpyConfigs.ecomWindow = "javascript";


// We've set "startPlayingOnload" so that you can see how the cover art image behaves as a link.
defaultWimpyConfigs.startPlayingOnload = "yes";

// Render the player on the page:

makeWimpyPlayer("blank.xml");


</script>

 

 

Part of the Wimpy MP3 Player Javascript Kit documentation.