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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.