Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update the embedded video using javascript/ajax

 
Kalyan Anand
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an embedded video in a web page



When I click a button the following java script code gets executed


Whereas it is not loading the new video on the page. Can this be done ?

[ May 18, 2008: Message edited by: Santhosh Jali ]
[ May 18, 2008: Message edited by: Santhosh Jali ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using getElementById with an id and set the src with the new value without the setAttribute.

Eric
[edit - fixed spelling mistake]
[ May 18, 2008: Message edited by: Eric Pascarello ]
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<embed name="video3" ...


It looks like "video3" is the value for the name attribute of this element. Maybe getElementById is looking for an id attribute?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic