I'm trying to create a new value for a variable to be passed to so_switch function using the url variable. I'm a complete newbie to javascript as a whole. Any help on the matter would be very appreciated.
The link to site its on is
<script type="text/javascript">
//json variables
var speakers = {
edmund_gordon: {
name: "Dr. Edmund Gordon",
attrib: "Richard March Hoe Professor Emeritus and Director of the Institute of Urban and Minority Education, Teachers College, Columbia University",
video: "edmund_gordon",
synopsis: "Perspectives from Dewey and Cremins on the Impact of Arts in Community."
},
maxine_green: {
name: "Dr. Maxine Greene",
attrib: "William F. Russell Professor in the Foundations of Education Professor of Philosophy & Education",
video: "maxine_green",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
},
shirley_brice_heath: {
name: "Dr. Shirley Brice Heath",
attrib: "Margery Bailey Professor of English and Dramatic Literature at Stanford",
video: "shirley_brice_heath",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
},
geoff_canada: {
name: "Geoffrey Canada",
attrib: "President/CEO of The Harlem Children's Zone",
video: "geoff_canada",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
},
linda_frye_burnham: {
name: "Linda Frye Burnham",
attrib: "Richard March Hoe Professor Emeritus and Director of the Institute of Urban and Minority Education, Teachers College, Columbia University",
video: "linda_frye_burnham",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
}
};
//Read url for Variables
var url = String(window.location);
var index = url.indexOf("?");
var data = url.substr(index+1);
var splitted = data.split("=");
var event = splitted[0];
var url_var = splitted[1];
var vid = "speakers."+url_var+".video";
var name = "speakers."+url_var+".name";
var attrib = "speakers."+url_var+".attrib";
var synop = "speakers."+url_var+".synopsis";
// Call for Video Page - JW Video Player
function so_switch( vid , name , attrib , synop ){
var s1 = new SWFObject('assets/jw/player.swf','ply','640','360','9','#000');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','transparent');
s1.addParam('autostart','true');
s1.addParam('flashvars','file= vid +'.flv&autostart=true' );
s1.write('player');
document.getElementById("info").innerHTML = '<h4>Currently Playing:</h4><p class="name">'+speaker+'</p><span class="attrib">'+attrib+'</em></span>';
document.getElementById("vid_desc").innerHTML = '<h4>Synopisis:</h4><p class="desc">'+synop+'</p>';
}
</script>
The link to site its on is
<script type="text/javascript">
//json variables
var speakers = {
edmund_gordon: {
name: "Dr. Edmund Gordon",
attrib: "Richard March Hoe Professor Emeritus and Director of the Institute of Urban and Minority Education, Teachers College, Columbia University",
video: "edmund_gordon",
synopsis: "Perspectives from Dewey and Cremins on the Impact of Arts in Community."
},
maxine_green: {
name: "Dr. Maxine Greene",
attrib: "William F. Russell Professor in the Foundations of Education Professor of Philosophy & Education",
video: "maxine_green",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
},
shirley_brice_heath: {
name: "Dr. Shirley Brice Heath",
attrib: "Margery Bailey Professor of English and Dramatic Literature at Stanford",
video: "shirley_brice_heath",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
},
geoff_canada: {
name: "Geoffrey Canada",
attrib: "President/CEO of The Harlem Children's Zone",
video: "geoff_canada",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
},
linda_frye_burnham: {
name: "Linda Frye Burnham",
attrib: "Richard March Hoe Professor Emeritus and Director of the Institute of Urban and Minority Education, Teachers College, Columbia University",
video: "linda_frye_burnham",
synopsis: "Test it out people I'm filling the inside of the description with this file. Yay."
}
};
//Read url for Variables
var url = String(window.location);
var index = url.indexOf("?");
var data = url.substr(index+1);
var splitted = data.split("=");
var event = splitted[0];
var url_var = splitted[1];
var vid = "speakers."+url_var+".video";
var name = "speakers."+url_var+".name";
var attrib = "speakers."+url_var+".attrib";
var synop = "speakers."+url_var+".synopsis";
// Call for Video Page - JW Video Player
function so_switch( vid , name , attrib , synop ){
var s1 = new SWFObject('assets/jw/player.swf','ply','640','360','9','#000');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','transparent');
s1.addParam('autostart','true');
s1.addParam('flashvars','file= vid +'.flv&autostart=true' );
s1.write('player');
document.getElementById("info").innerHTML = '<h4>Currently Playing:</h4><p class="name">'+speaker+'</p><span class="attrib">'+attrib+'</em></span>';
document.getElementById("vid_desc").innerHTML = '<h4>Synopisis:</h4><p class="desc">'+synop+'</p>';
}
</script>