change the 'src' value using javascript

This is a discussion on "change the 'src' value using javascript" within the JavaScript Forum section. This forum, and the thread "change the 'src' value using javascript are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jan 6th, 2008, 19:07
New Member
Join Date: Jan 2008
Location: greece
Age: 20
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
change the 'src' value using javascript

hello

i want to know if there is any way to change the src value in the embed code using javasript.
i want to embed a media player to stream mms urls and for this i want to use some buttons links to change the channel on the media player.is there a way to use javasript in the src value or i have to load eatch time a different page for each channel?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 6th, 2008, 19:12
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: change the 'src' value using javascript

Post your code so far.
You can do this pretty easily if you set an ID for the embed tag.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 6th, 2008, 19:26
New Member
Join Date: Jan 2008
Location: greece
Age: 20
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: change the 'src' value using javascript

Quote:
Originally Posted by alexgeek View Post
Post your code so far.
You can do this pretty easily if you set an ID for the embed tag.
alex thank u for the reply

untill now i use a different html page for each channel with embeded wmp and i use a list of links to call the html page.

i dont know how to use javascript and thats why i ask.i know that there is a way to manage what i want to do but i dont know.

i only know how to embed a wmp using embed or object tags

i would be happy if someone show me the way...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 6th, 2008, 20:31
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: change the 'src' value using javascript

I meant could you post your hmtl code.
As in the embed code you are using at the moment
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 6th, 2008, 21:43
New Member
Join Date: Jan 2008
Location: greece
Age: 20
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: change the 'src' value using javascript

Quote:
Originally Posted by alexgeek View Post
I meant could you post your hmtl code.
As in the embed code you are using at the moment
ok at the moment i use this embed code:

Code: Select all
<embed src="mms://..........?sid=FB398D6B-E0E9-4A99-9CF1-4E71FD187F08-8-24852" width="400" height="400" autostart="1"
 showcontrols="1" type="application/x-mplayer2"
 pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"> </embed>
very simple code as u see.i know i need to use object tag...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 6th, 2008, 21:50
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: change the 'src' value using javascript

Use this (I've added an ID attribute):
HTML: Select all
<embed src="mms://..........?sid=FB398D6B-E0E9-4A99-9CF1-4E71FD187F08-8-24852" width="400" height="400" autostart="1"
 showcontrols="1" type="application/x-mplayer2"
 pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" id="stream"> </embed>
And try this pseudo JS:
HTML: Select all
document.getElementById("player").src = 'newsrchere'
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript to change Base href? Zonglars JavaScript Forum 11 Jul 28th, 2007 00:32
Javascript detect Flash, change CSS? bigd JavaScript Forum 0 May 3rd, 2007 08:20
change DIV moiseszaragoza JavaScript Forum 1 Mar 15th, 2007 00:32
[SOLVED] How To: Change characters in a textarea? Using Javascript Anonymous User JavaScript Forum 0 Feb 16th, 2005 12:34
how do u change the content of a <div> with javascript benbacardi JavaScript Forum 4 Jun 26th, 2004 19:14


All times are GMT. The time now is 19:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42