Example 9

This example shows you how to use javascript to communicate with an ecommerce system, which utilizes the same basic setup as Example 8.

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.

The differences between this and Exampel 8 are:
- Added Foxycart code to the <head> area of the page
- Using playlist5.xml, which contiains links to the FoxyCart ecommerce engine.
- Using the "fc_tb_show" funciton to engage the Foxycart engine.
- Using a skin that replaces the -> arrow link with a graphic.

This DIV contents to be replaced by Rave.

 

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='rave.js'></script>
<div id="flashcontent">This DIV contents to be replaced by Rave.</div>
<script language="JavaScript" >

// NOTE: See actual source code ofthis page for detailed comments.

// Set config options:
defaultWimpyConfigs.wimpyWidth = "332";
defaultWimpyConfigs.wimpyHeight = "389";
defaultWimpyConfigs.wimpySkin = "skins/skin_js_examples_buy.xml";


// Set the behaviour to "link":
defaultWimpyConfigs.clickWindowAction="link";
defaultWimpyConfigs.infoButtonAction="link";


// Wire the linkToWindow to javascript:
defaultWimpyConfigs.linkToWindow="javascript";

// Enable handler events:
enableWimpyEvents = true;

// Re-write the handler function:
function handleLinkClick(returnedObject){
   fc_tb_show("", unescape(returnedObject), "");
}


// Set the default playlist:
defaultWimpyConfigs.wimpyApp = "playlist4.xml";

// Render the player using the default configs:
makeWimpyPlayer();

</script>

 

 

 

 

 

 

Part of the Wimpy Rave documentation.
©2009 Plaino