Jump to content

change video onclick without refreshing screen


ballhogjoni

Recommended Posts

Hi everyone,

 

I am new to javascript and wanted some help figuring out how I would change the video on one part of the page when clicking on a link all without the screen reloading. something like cnn.com/video/

 

Any ideas? I don't have any code written and I have searched google for some info but couldn't find any.

 

I have an idea of what I want it to do:

I want to have a div or a table that contains the <object></object> tag and within that there is a url that tells the <object> which video to play. basically all the url's will be the same except for an idenifier.

 

So lets say I have this url:

http://blahblah.com/videos?id=1

 

How would I change that number 1 to 2,3,4, etc using javascript and without refreshing the screen. I am thinking my html code would look like:

 

http://blahblah.com/videos?id=<span id="videoID">

 

so when someone clicks a link that looks like:

<a href="javascript:functionName(1);">click</a>

 

It would dynamically insert the number 1 in the place of <span id="videoID">

 

Thanks,

Chris

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.