JavaScript - Rediriect After Wmv Is Finished Playing .... Help!
Hey there guys, i have a client who wants to make a school system on his website, now i've done that, however what my client wants is to put wmv files inside every lesson and he wants to be sure that the user who has registered to the online school WATCHES fully all the wmv and then redirect him to a quiz page where he will take a test.
My client wants to be sure that the users are watching the wmv files before doing any quiz. SO is there a way where i can know when the wmv file has FINISHED playing so that i would redirect them to another page?? Thank you! Similar TutorialsHey guys! I have finally finished my factoring quadratics page! You can see it he http://wdroom.com/factor.html If you see that you received an incorrect solution PLEASE let me know so I can fix it. Credits: Old Pendant, Philip M, bullant in no particular order Thanks so much! Hi, Does anyone know if there is a event or something that fires when Javascript finishes executing. When I load a page, the body's onLoad event fires when it has finished loading but there might be some Javascript that is still running (or javascript that is triggered from the onLoad event itself). And this javascript could add to the page's DOM. So is there any way to detect when the page has REALLY finished loading (ignoring the possibility of setTimeout() etc). I need to know this as I am constructing a webpage-scraper and therefore I need to know when the pages have completely loaded. Thanks, Hey guys, finished my first javascript assignment and was wondering if anyone could confirm it works. I get weird syntax errors on my comp but others have said that it has worked for them, so i'm wondering if anyone else can confirm this. The syntax errors are all claiming that my functions being called in my buttons are not defined, however they clearly are, so i'm thinking it might just be something weird with my machine/browser. Anyway, here's the code and thanks in advance. Code: <html> <head> <script type="text/JavaScript"> var sam = 9; var sally = 8; var donald = 4; var person = prompt("Please enter your name", "Student Name"); if (person != null) { document.getElementById("intro").innerHTML = "Hello " + person + "! Thank you for checking your grades today!"; } function percentage (score) { return score / 10 * 100; }; function goperc() { document.write("Sam's score on the test is " + percentage(sam) + "%, <br \> Sally's score on the test is " + percentage(sally) + "%, <br \> Donald's score on the test is " + percentage(donald) + "%"); }; function highscore() { if (Math.max(90, 80, 40) === 90){ document.write("Sam's score was the highest.")}; else if (Math.max(90, 80, 40) === 80){ document.write("Sally's score was the highest.")}; else{ document.write("Donald's score was the highest.")} }; function lettergrade(grade) { if (grade > 8.9){ document.write("A")}; else if (grade > 7.9){ document.write("B")}; else if (grade > 6.9){ document.write("C")} else{ document.write("F | Warning, your letter grade is very low.")} }; function goletter() { document.write("Sam's letter grade on the test is: " + lettergrade(sam) + ", <br \> Sally's letter grade on the test is: " + lettergrade(sally) + ", <br \> Donald's letter grade on the test is: " + lettergrade(donald)); }; </script> </head> <body> <button onclick="goperc()">Student Percentages</button> <br \> <button onclick="highscore()">Best Grade</button> <br \> <button onclick="goletter()">Student Letter Grade</button> </body> </html> Oh, if anything looks like it's wrong or you see something that could be causing an error, I would love to know. Thanks. Is it possible to make an app that creates a gif that shows the process of a finished drawing? Im a kid and love drawing and gif . i wanna make app that shows a replay of my initial start of my drawing till the finish product of my drawing in a gif file. thinking to approach this with javascript? would it be possible? Hello, In the below script syntax, a simple table converts Celsius degrees into Fahrenheit, using the For loop and integrating it into a table. Code: <html> <head> <title>Celsius-Fahrenheit Converter</title> </head> <body> <table border=3> <tr><td>CELSIUS</td><td>FAHRENHEIT</td></tr> <script language="javascript"> for (celsius=0; celsius<=50; celsius=celsius+1) { document.write("<tr><td>"+celsius+"</td><td>"+((celsius*9/5)+32)+"</td></tr>"); } </script> </table> </body> </html> My questions are about the following script inside the <td> tags: <td>"+celsius+"</td> <td>"+((celsius*9/5)+32)+"</td> 1) why is the script inside the above <td> tags placed between " " ? 2) why is the script inside the above <td> tags placed between + + ? Thanks a lot for your explanation to an absolute Javascript beginner...! I've got this JavaScript code that I'm using to play audio on my site made specifically for iPhones, iPods, and whatnot. However, my only problem is, that I can only pick one audio file to play from, no matter what. Can someone tell me what I'm doing wrong? I really need this specific code cause it allows me to play audio without going into the Media Player on the iPhone and iPod. Here's what I have in the head section: Code: <script type="text/javascript"> function play_single_sound() { document.getElementById('audiotag').play(); } </script> And the body: Code: <div id="audio"> <audio id="audiotag" src="audio.wav" autobuffer="autobuffer"></audio> </div> And now to actually play the audio: Code: <a href="javascript:play_single_sound();">Play audio</a> I can play audio fine, but I'm only limited to one audio file per page. Is there anyway around this?? I would like to play a .wav sound file when someone hovers their mouse/pointer over an image. Could someone help me out here please. I am running a Linux OS. Thanks.
Is it possible to play a sound file when a visitor to my website moves their mouse/pointer over a single image no matter what browser they are using? Thanks for any help or advice.
Hi, I need some help with playing sounds with javascript. What I need: When the user clicks the button it will run the function and play a sound either from the source or embedded into the website(which ever way works). Thanks alot! Suppose I have some function ... myFunction(); And I want it to be executed from 3am - 11pm but not at any other time So far what i had done is along the line of Code: for(i=0;i<99999;i++) { var time = new Date(); var hours = time.getHours(); if (hours>=3 && hours<=23){ myFunction(); } } What happens so far is that: If it is the right time it loops over and over and continually executes the function (which is what I want) If it's the wrong time (not 3am-11pm) it loops once, doesn't execute the functoin and then the script finishes (whereas I want it to continue looping until the right time comes along) If its the right time and then it moves to the wrong time it stops looping, whereas i want it to not execute the function but continue looping until the right time comes around again. So the overall affect is that at the given times of day the script plays and when its not the correct time it doesnt and then when it is the right time again it starts playing again, seemlessly and continually How can I play a sound when I click an image, without the information bar popping up at top? I've looked all over, and I've tried a few javascript-only methods but none have worked for me.. Is flash the only way to go?
I am trying to write a game in javascript that will play a tune when a certain score is reached. I can get music to play if i put the code behind a button but I would prefer to use an if statement in the header section. Any suggestions please???? Many thanks
I can play a sound on my local machine using the following code, but when I upload to a server the same code it does not play. I cannot work out why, the link below gives the code. The multi channel code is he http://www.storiesinflight.com/html5/audio.html I installed Firebug and insepcted the Net components and can see that the .wav files are being sought out but returning a 404 error. This would be fine, however the path being sought is correct. Clicking link does'nt play the sound, but removing the file and paring back to the directory brings you to the directory on the server and clicking the file does play the sound. The code works locally, and I simply cannot see what could be causing the issue in the server versions on both Firefox and Chrome. How could I make it so that instead of seeing a embed object you would just see a input button that says play. I do not need my users to be able to pause them. I really didn't know where to start with the javascript but i do have the html5 Code: <audio controls="controls"> <source src="BlackHawkDown-MusicVideo-Frontline.wav" type="audio/wav" /> <source src="BlackHawkDown-MusicVideo-Frontline.mp3" type="audio/mpeg" /> Your browser does not support the audio element. </audio> THANKS!!!! I wrote the following small HTML page, trying to play a sound in Firefox 8 and Internet Explorer 9. The button and the <a></a> link work fine, but calling from the <script></script> tag does nothing. Does anybody know, what can be wrong, and what I can do? I'm sorry, you have to supply the oef.wav file, since I can't upload it. Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Mozilla/4.05 [en] (Win95; I) [Netscape]"> <meta name="Author" content="Torben Amtrup"> <title>Soundtest</title> <script> function EvalSound(soundobj) { var thissound=document.getElementById(soundobj); thissound.Play(); } </script> </head> <body> <embed src="oef.wav" width="1" height="1" id="sound1" enablejavascript="true" autostart="false"> <form> <input type="button" value="Play Sound" onclick="EvalSound('sound1')"> </form> <a onclick="EvalSound('sound1')">Play Sound</a> <script language="JavaScript"> EvalSound('sound1'); </script> </body> Our website normally plays music onload that can be stopped when manually starting a video using onclick="stop1()". I've manipulated a javascript that detects if the user is a new or return user and plays the video automatically in a popup if the user is new. But, I cannot figure out how to either stop the music or prevent the music from starting at the same time. I've really got no experience with js and am fumbling my way around. would appreciate your help. Hi there, Not sure what sub category this falls under sorry, but I have an issue changing a table based menu to a css based menu. This has been done however the javascript code no only partly works, I would like for it to completely work and am not sure whether I should use aspanel or <div> tags to get it to work as I have tried both and neather seem to work so there is something i am obviously missing! here is the javascript: Code: $(function() { $('#mainCategories a').live('click', function() { $.ajax({ type: "GET", contentType: "text/html; charset=utf-8", dataType: "html", url: "/ajax/menu.aspx?CategoryId=" + this.name, cache: false, success: function(newMenu) { $("#left-menu-control").replaceWith(newMenu); $('html, body').animate({ scrollTop: 0 }, 'slow'); } }); return false; }); $('#left-menu-collapse-category').live('click', function() { $.ajax({ type: "GET", contentType: "text/html; charset=utf-8", dataType: "html", url: "/ajax/menu.aspx", cache: false, success: function(newMenu) { $("#left-menu-control").replaceWith(newMenu); } }); return false; }); }); and here is the page code: Code: <div id="menu-left"> <asp:Panel ID="pnlLeftMenuControl" runat="server"> <asp:Panel ID="pnlCategories" runat="server"> <asp:Panel ID="pnlCurrentlyViewing1" runat="server" Visible="false"> <div id="menu-left-main-categories"> <div id="menu-left-currently-viewing-title">Currently Viewing...</div> <div id="menu-left-currently-viewing-close"><a href="javascript:void(0);" title="Collapse category" id="left-menu-collapse-category"><img src="~/images/button-menu-left-currently-viewing-close.jpg" runat="server" border="0" /></a></div> </div> </asp:Panel> <asp:Panel ID="pnlCurrentlyViewing2" runat="server" Visible="false"> <div id="menu-left-currently-viewing"> <div id="menu-left-currently-viewing-text"><asp:Hyperlink ID="hlCategory" runat="server" CssClass="left-menu-viewing"></asp:Hyperlink></div> </div> </asp:Panel> <asp:Panel ID="pnlSubCategories1" runat="server" Visible="false"> <asp:Repeater ID="rptSubCategories" runat="Server"> <ItemTemplate> <div id="menu-left-currently-viewing"> <div id="menu-left-currently-viewing-text">- <asp:HyperLink ID="hlSubCategory" runat="server" CssClass="left-menu-viewing"></asp:HyperLink></div> </div> </ItemTemplate> </asp:Repeater> </asp:Panel> <asp:Panel ID="pnlMainCategories" runat="server"> <asp:Repeater ID="rptMainCategories" runat="server"> <ItemTemplate> <div id="menu-left-main-categories"><div id="menu-left-main-categories-text"><asp:HyperLink ID="hlCategory" runat="server" CssClass="left-menu"></asp:HyperLink></div></div> </ItemTemplate> </asp:Repeater> </asp:Panel> </asp:Panel> <asp:Panel ID="pnlBrands" runat="server" Visible="false"> <asp:Panel ID="pnlBCurrentlyViewing1" runat="server" Visible="false"> Currently viewing... </asp:Panel> <asp:Panel ID="pnlBCurrentlyViewing2" runat="server" Visible="false"> <asp:Label ID="lblBCurrentlyViewing" runat="server" CssClass="left-menu-viewing"></asp:Label> </asp:Panel> <asp:Repeater ID="rptBrands" runat="server"> <ItemTemplate> <asp:HyperLink ID="hlBrand" runat="server" CssClass="left-menu"></asp:HyperLink> </ItemTemplate> </asp:Repeater> </asp:Panel> </asp:Panel> </div> any help would be greatly appreciated I have a simple mobile app designed using PhoneGap. I am some mp3 in it and I am using the Media plugin of PhoneGap. Everything is working fine, the audio is playing and so on. The issue, I noticed after playing 8-12 times, the audio stops playing. I do not get sound. Here are my codes: Code: <script> document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() {} // Audio player var media = null; var audioP = false; // Play audio function playAudio(src) { if (audioP === false) { media = new Media(src, onSuccess, onError); media.play(); audioP = true; } else { media.release(); } } // onSuccess Callback function onSuccess() { console.log("playAudio():Audio Success"); audioP = false; } // onError Callback function onError(error) {} </script> Help! I want to use HTML5's audio coding similar to the one below: Code: var audioElement = document.createElement('audio'); audioElement.setAttribute('src', 'horse.ogg'); audioElement.play(); In order to play sound files depending on the input. What I'm working on is a text-to-speech webapplication. What I'd need to happen is for there to be an input and then allow the user to type anything into the input, so if they type in: Hello, how are you doing? Javascript or PHP will recognize each character and translate it into an audio sequence. In example: It'd detect the "H" in hello and play sound file "H.ogg" It'd then detect the "E" in hello and play sound file "E.ogg" I know there must be an easy way to do this. I am using this fancy box code to smoothly pop up an image on click, I got it working on my main index page but that's not where I want to put it. My site has a menu where it loads webpages inside the main index one, I would like to use the code on one of those pages but something is not working. I am not able to use the specified DOCTYPE but find that it works all the same with my current one, however if I use the given one in addition to the one I have now (and need) then my site does not work properly, further if I replace it I get the same results. My existing doctype: Code: <DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> What the code uses: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> I'm not sure what the differences are but I've been advised that I need to run the code in "standards mode" before I try to fix it. As I see it the code works, just not where I need it to, nothing unusual on my site and nothing unusual that I may be wrong. On my site you can see at the bottom right a blue text link called "aaaa" this is the code that works, however (clicking the dome to the left of that to scroll the page down and selecting the "met.a has guts" menu option diagram) you'll see the "aaaa" link again at the bottom left of that page and that is where I need it to work from. I even tried using the exact code from the example in that linked .htm page but it doesn't make a difference, it probably even hinders the code as it looks at the main html page. But if loading the page on its own the code will work, so its related to the menu and the way that works. If anybody can help that would be brilliant, I'm sure its something simple. Thanks! |