XML, Javascripts and Google Gadgets

admin

Administrator
Staff member
So I posted this over at the Javascript forum, but got no replies...I'm hoping that someone can tell me what I am doing wrong.

*********************************

So I want to syndicate my animated shorts via google gadgets. I thought it would be easy. Anyway, I'm a rookie at both xml and javascript...here's my code:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="The Retired Porn Producer's Guide to..."
title_url="http://www.retiredpornproducer.com"
render_inline="optional"
description="Find out if you could make it in the skin flik bizz."
screenshot="onepagesmall.jpg"
author="Christopher Guest and Scott Albert"
author_email="[email protected]"
author_location="Toronto, Ontario"
author_quote="Check out the show"
height="300"
scaling="true"
width="300"/>

<UserPref name="eps" datatype="enum" default_value="Episode1">
<EnumValue value=http://www.webdeveloper.com/forum/archive/index.php/"Episode1" display_value="A Complicated Man"/>
<EnumValue value="Episode2" display_value="Blogging"/>
<EnumValue value="Episode3" display_value="Office Meetings"/>
<EnumValue value="Episode4" display_value="Water Cooler Chit-Chat"/>
<EnumValue value="Episode5" display_value="Biking to Work"/>
</UserPref>

<Content type="html">
<![CDATA[
<div id=playvideo>
<script>
function switcher (vid) {
switch (vid) {
case ("Episode1"):
vidplay = "mediaId:108118;affiliateId:44409";
return (vidplay);
break;
case ("Episode2"):
vidplay = "mediaId:108119;affiliateId:44409";
return (vidplay);
break;
case ("Episode3"):
vidplay = "mediaId:108163;affiliateId:44409";
return (vidplay);
break;
case ("Episode4"):
vidplay = "mediaId:108121;affiliateId:44409";
return (vidplay);
break;
case ("Episode5"):
vidplay = "mediaId:108122;affiliateId:44409";
return (vidplay);
break;
}
}
var prefs = new _IG_Prefs(__MODULE_ID__);
var episode = prefs.getString("eps");
switcher (episode);
document.write(vidplay);
</script>
<script src="http://flash.revver.com/player/1.0/player.js?" + vidplay + ";height:220;width:280;" type="text/javascript"></script>
</div>
]]>
</Content>
</Module>


But it doesn't work when I test it at:
<!-- m --><a class="postlink" href="http://www.google.com/apis/gadgets/gs.html#Writing_mods">http://www.google.com/apis/gadgets/gs.html#Writing_mods</a><!-- m -->

Anyone have any ideas?

************************
No I think the problem has to do with passing a variable into a <script src></script>...is that even possible?

I'm open to doing any other way, but I'm lost at this point.
 
Back
Top