Example 9
This example shows you how to use javascript to communicate with an ecommerce system.

We are using the Foxycart ecommerce system, due to it's simple and straight forward javascript API. However, other you should be able to integrate this kind of set up with any other ecommerce system that has a javascript API.

>> Click the cover art graphic OR the shopping cart icon in the player below <<

 

You need to upgrade your Flash Player

 

 

Source Code

In the <head> tag we've included the Foxycart code:

<!-- BEGIN FOXYCART FILES -->
<script src="https://wimpy.foxycart.com/files/foxycart_includes.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="https://wimpy.foxycart.com/files/foxybox.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="https://wimpy.foxycart.com/themes/standard/theme.foxybox.css" type="text/css" media="screen" charset="utf-8" />

<!-- END FOXYCART FILES -->

And in our <body> we've included the code to setup and render the player:

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

//////////////////////////////////
// Here we are over-writing the handleLinkClick funciton within wimpy.js.
// Since this area loads after wimpy.js, this function will replace the
// same exact function within wimpy.js.


function handleLinkClick(returnedString){
   fc_tb_show("", unescape(returnedString), "");
}


//////////////////////////////////
// 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.