|
Hey i was designing a website which plays a no of music station live. For this i used the Media Player for website and setted its src ='http://www.bollywoodhungama.com/scripts/bollywoodhungama.asx'
Now i want to have Buttons through javascript and want that if a user click on the buttons than that particular channel should be switched.
<HTML>
<HEAD>
<script type="text/javascript">
function change()
{
window.location.reload();
function chg()
{
document.getElementById("myplayer").setAttribute("src", "mms://216.185.43.237/radiocity 1");
}
}
</script>
</HEAD>
<body>
<embed id="myplayer" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" showstatusbar="true" enablecontextmenu="false" autostart="false" width="320" height="60" loop="false" src="http://www.bollywoodhungama.com/scripts/bollywoodhungama.asx " />
</embed>
<input type='button' onclick='change()' value='Change'/>
</body>
</HTML>
Here i have used this Change() function to reload the page so that the station should stop playing. and now here i have added function chg() inside this and i want that after reload the src value should get changed and on starting the player another station should start playing.
But this is not working ?
Is it possible to change the src to new value after page reload ?
Please suggest.
All i want is that the "src" value should get change anyhow.....and one should be able to switch playing stations.
|
|
|
|
|
try this
document.getElementById("myplayer").src="Your url";
|
|
|
|
|
Already tried that but not working.
Please help changing play station.
|
|
|
|
|
Hi
window.location.reload()
does this funtion load the html document again ?
if yes, document will be new parsed include javascript ?
does embed support ID or only NAME ?
does "myplayer" have .src allready and you create this attribute again ?
where will function chg() be called ?
onclick
Media Player from Microsoft .... try HTML-5-Media (webM, ogg)
or try Quicktime (if you want go to my webpage www.twseiten.com
for informations).
|
|
|
|
|
I think twseitex is correct, your reload is a short circuit to changing the src value.
Try removing the reload and just setting the src value with the function.
<script type="text/javascript">
function change()
{
document.getElementById("myplayer").setAttribute("src", "mms://216.185.43.237/radiocity 1");
}
</script>
Chris J
www.redash.org
|
|
|
|
|
Error: Access to restricted URI denied" code: "1012 [Break On This Error]
xhttp.send(null);
function getXML(xml_file) {
if (window.XMLHttpRequest) {
var xhttp = new XMLHttpRequest();
}
else {
var xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",xml_file,false);
xhttp.send(null);
var xmlDoc = xhttp.responseXML;
return (xmlDoc);
}
I used same code for another page and it worked. But suddenly its giving this error.
I pass projects.xml as xml_file to the function.
Can some tell whats happening?
|
|
|
|
|
Access permissions on the target folder / file, sounds like the problem.
Have you checked the privileges for the end points and compared the one that works with the one that doesn't?
|
|
|
|
|
In my project , For Lower version ie, its not support canvas object so we are using flash canvas separate plugin . its given canvas object for lower version of ie so flash installation is necessary for that. Our problem is how find out flash plugin already installed or nor . if not installed how can installed with in our page. Help me...
Thanks...
|
|
|
|
|
I don't know I am right or not but when you add flash plugin by <object> tag then you can provide installation link when you don't find plugin. It will detect if plugin install or not and if not installed it will show the link where to install it.
I might be wrong but you should search on that may be it help you.
|
|
|
|
|
Hi,
Example for Flash in use of video ....
I code for Internet Explorer only HTML-tag <object>.
For Opera and Co.: Dynamically create flash with no problems.
test-flash-file must exist for create OBJECT dynamically
f.e. check out Shockwave-plugin.
<object type="application/x-shockwave-flash" width="1px" height="1px" data="your_testfile_must_exists.swf" style="visibility:hidden">
Better: User HTML-5-Video like WebM from Google or Quicktime with HTML.
script tested in IE 8: dynamically create not possible
// +++++ check document.body
if(X00){X00=(document.body!=null);}
if(X00)
{
// +++++ IE create errror during build OBCECT object
// in use if createElement() and .innerHTML and normalize() too
//
// X02=document.createElement('OBJECT');
// X00=(X02!=null);
//
// if(X00)
// {
// var X03=document.body.appendChild(X02);
// X00=(X03!=null);
// }
//
// if(X00)
// {
// var X04=document.createElement('PARAM');
// X00=(X04!=null);
// }
//
// if(X00)
// {
// var X05=X03.appendChild(X04);
// X00=(X05!=null);
// }
//
// if(X00)
// {
// X05.name="movie";
// X05.value="path" + "your_flash_file.swf"; // it must exists (blanc video)
//
// X03.style.visibility='hidden';
//
// try
// {X03.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; // 20100928 http://kb2.adobe.com/cps/415/tn_4150.html
//
// X00=(X03.classid!='');
//
// X00=document.body.removeChild(X03);
// }
// catch(e){X00=false;}
// }
//}
If you want, for Flash in IE and Opera and Co. see my webpage www.twseiten.com
|
|
|
|
|
Am looking for a code that will help me add minimize and maximize buttons in a dfd in my company intarnet website. please anyone having a clue how i can do it please help.
|
|
|
|
|
Dan muli wrote: minimize and maximize buttons in a dfd
What do you mean by dfd?Please try and reword your question to explain more clearly what issue you are facing.
|
|
|
|
|
Thanks ,for example our company intranet has window sections eg one for the cognos application i want to append some minimize and maximize buttons such that i can make the cognos application occupy the whole screen in order to have a good view of project ratios graph of my company
|
|
|
|
|
what is a 'dfd' ? What application is it? Windows Forms or ASP.NET ?
|
|
|
|
|
|
you did not answer my first question, what is 'dfd'?
|
|
|
|
|
I assume it isn't a Data Flow Diagram.
|
|
|
|
|
I assume it is a Data Flow Diagram, he probably wants to put a mockup diagram on the DFD.
|
|
|
|
|
I have a large list of authors, book titles, and comments in an SQL database. I am able to pull those records with PHP.
I want to populate a web form with this information dynamically (Javascript), but since I have never used AJAX or json, I've not known how to do this any other way.
So what I've done is have my PHP generate a 2D Javascript array which contains all of the entries like this:
var author_title_comment = new Array();
author_title_comment.push( new Array("Author 1", "Title 1", "Comment 1") );
author_title_comment.push( new Array("Author 2", "Title 2", "Comment 3") );
...
author_title_comment.push( new Array("Author 3999", "Title 3999", "Comment 3999") );
author_title_comment.push( new Array("Author 4000", "Title 4000", "Comment 4000") );
It's not pretty, but it functions well locally.
The same thing could probably be re-written like this:
var author_title_comment = [];
author_title_comment[author_title_comment.length] = new Array("Author 1", "Title 1", "Comment 1");
author_title_comment[author_title_comment.length] = new Array("Author 2", "Title 2", "Comment 2");
...
author_title_comment[author_title_comment.length] = new Array("Author 3999", "Title 3999", "Comment 3999");
author_title_comment[author_title_comment.length] = new Array("Author 4000", "Title 4000", "Comment 4000");
Since the push() function can handle more than a single entry[^], would this be more efficient:
var author_title_comment = new Array();
author_title_comment.push(
new Array("Author 1", "Title 1", "Comment 1"),
new Array("Author 2", "Title 2", "Comment 3"),
...
new Array("Author 3999", "Title 3999", "Comment 3999"),
new Array("Author 4000", "Title 4000", "Comment 4000")
);
So I can either 1: use author_title_comment.push( new Array("Author 1", "Title 1", "Comment 1") ); on every element I want to add. 2: use author_title_comment[author_title_comment.length] = new Array("Author 1", "Title 1", "Comment 1"); on each element, or 3: use a single push() with all 4000 elements as additional parameters.
Or #4, learn a better way to do this and have the content dynamically generated whenever the user adds/removes a new author name, book title, or comment. 
|
|
|
|
|
#4 Learn a better way. JSON Examples[^]
JSON is basically a collection of name/value pairs
"books":
{
"book":
[
{"author": "John Steinbeck", "title": "Grapes of Wrath", "comments": "Lenny killed the rabbit" }
]
}
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
<a id="href1" href="#">gogo</a>
function goUrl(url) {
location.href = url;
}
i want to add goUrl event to href tag when i click href.
below is what i try.
var href1_obj = document.getElementById("href1");
//this is start as soon as load window.
href1_obj.onClick = goUrl("http://naver.com");
How can i do that?
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
function goUrl(url)
{
var temp = url;
return function() { location.href = temp; };
}
This will do the trick as the onClick handler needs to receive a function.
Cheers!
—MRB
|
|
|
|
|
|
i am sorry, i misunderstand.
This function is working.
Thank you have a nice day!!
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Your welcome! 
|
|
|
|