fry2010 Posted March 11, 2009 Share Posted March 11, 2009 Im not sure if this is the correct section for this question. I have done plenty of searches but cant find anything relating to my question. What I would like is to press a button in my admin control section and an alarm sound is played to every registered user that is logged in. Is this even possible? The only app I can think that would make this possible is ajax, but im not familiar with this. Any help appreciated. Quote Link to comment Share on other sites More sharing options...
corbin Posted March 12, 2009 Share Posted March 12, 2009 Possible? Yes. Easy.... Eh, kinda. How much about AJAX do you know? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 12, 2009 Share Posted March 12, 2009 Well off the top of my head, first I would add this to all the pages you want to play the sound. It will be the container that the sound loads into. <span id="loadSound"></span> In your head, you will either need to place your JavaScript, or link to the JavaScript file. next, in the php/html file that will be called, you will need to have this: <embed src="/music/sound.mp3" loop="false" hidden="true" autostart="true"></embed> It will load into the span tag using AJAX, and play one time. Quote Link to comment Share on other sites More sharing options...
fry2010 Posted March 12, 2009 Author Share Posted March 12, 2009 Thanks for reply guys. I have pretty much no knowledge of ajax or even javascript for that matter, well I have read a bit on it and seems pretty simple, but I havnt coded anything in it. Im sorted for this though I basically will be having a javascript chat and some of the packages I have looked at include sounds to be played so Im sorted, Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 12, 2009 Share Posted March 12, 2009 You might want to give this a read: http://www.tizag.com/ajaxTutorial/ Quote Link to comment Share on other sites More sharing options...
fry2010 Posted March 13, 2009 Author Share Posted March 13, 2009 Yeah i do understand what ajax does and how it works. My thinking was that if I was to press a button somehow that would need to be delivered to my audience, and because they wouldnt be loading the page themselevs I would need to have sent it to them in an ajax part. Now I think about it a bit more ajax is probably not the thing for it anyway, it probably would even do it. Thanks for help tho I am sorted on this. I do however have another issue. I dont really want to open a new thread seeming as I have started this one. I dont know if you guys know anyway I can hide an <applet> code from the source code view, as I want to hide the applet. I have read around and it seems like there is no way to do it. I would have thought it should be possible, as php doesnt get loaded into the source code because its generated server side. So would there be anyway to load this applet in that way? The only other solution would be to place the code outside of the document tree on the hosting platform. But I dont know how I would grab the data from it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.