This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Update the embedded video using javascript/ajax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Update the embedded video using javascript/ajax" Watch "Update the embedded video using javascript/ajax" New topic
Author

Update the embedded video using javascript/ajax

Kalyan Anand
Ranch Hand

Joined: Feb 07, 2007
Posts: 194
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jan 19, 2001
Posts: 4012
    
    6
<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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Update the embedded video using javascript/ajax