/    Sign up×
Community /Pin to ProfileBookmark

dynamically changing the source of an <embed> or <object>

Hi!

I am currently developing a little webpage with a picture of a tv and a video playing in it. What i want to do is to be able to click any of a nu,ber of links to video files and have them play in the tv. Currently i am trying to acheive this with the innerHTML property of the <div> where i have my <object> and <embed> but it is not quite working, and even if it would work i imagine this is a fairly ugly solution. So, after this rambling, my question is simple: How can i do this? A few hints, links and/or suggestions are highly appreciated ?

Good night
–Anders

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceApr 20.2006 — Considering that your post was viewed 86 times (but noone answered it), it might help if you reviewed the posting guidelines you'll find in the sticky threads at the top of this forum -- which are inteded to [u][i]help you[/i][/u]; [b]not[/b] cruelly criticize you. ? However, to summarize a few of them (in no particular order):
[list=1]
  • [*]A lack of specific information on a particular problem usually causes the casual visitor to bypass your post -- for example, no mention of actual error message text and/or no indication as to which line of code is the problem. Why? Because, most people don't like to take their time to play 20 questions in an attempt to find out more.

    [indent][b]Hint:[/b] To find error messages in IE, display the status bar and, at the left side, double-click the little, yellow triangle (if there is one). To find error messages in NS or FF, use the menu bar to open the Tools / JavaScript Console dialog box.[/indent]

  • [*]A big, long description, a lot of source code (especially, the unexplained kind), and/or links to other resources usually discourage the casual visitor from attempting an answer. Why? Because it would require too much of the visitor's time to figure out what it's all about. Visitors like to see that the OP (original poster) has done their own homework on the issue.

  • [*]Asking for multiple answers/solutions, in the same thread, can also cause the casual visitor to bypass your post. Why? A visitor may only wish to use their time to answer just one question -- but, by answering the one, then the OP will automatically expect additional answers from them.

  • [*]Almost any post, without at least [u][i]some[/i][/u] accompanying code, may discourage the casual visitor from answering -- especially if it seems like, or is actually stated, that a complete solution is desired. Why? Because it takes a lot more of the visitor's time to develop a complete solution.
  • [/list]

    Did you notice repeated mention of the "casual visitor" and [u][i]their time[/i][/u]? You see, this site is [b][u][i]not[/i][/u][/b] intended as a place to obtain free contract-programming services. Thus, every person that answers questions here is simply a visitor to this site -- as you were. Hence, if you're really, really new to JavaScript, or haven't ever made the time to take a complete [URL=http://www.webreference.com/programming/javascript/diaries/]JavaScript Tutorial[/URL], then your best course of action is to start there.

    So, if you'd like to post again, and resolve these issues, then I'm sure someone would like to help answer your question -- including myself! ?

    Cheers.
    ×

    Success!

    Help @rymdninja spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...