View Single Post
Old 02-13-2013, 04:32 AM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,579
Thanks: 62
Thanked 4,064 Times in 4,033 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
By the by, a sneaky way I do this:
Code:
<a href="someFile.wav" target="hiddenFrame"> Play sound </a>

<iframe name="hiddenFrame" style="width: 100%; height: 100ps; display: none;"></iframe>
Or you can pass in the file name and parse the query string:
Code:
<a href="playSound.html?file=someFile.wav" target="hiddenFrame"> Play sound </a>

<iframe name="hiddenFrame" style="width: 100%; height: 100ps; display: none;"></iframe>
And then your "playSound.html" (or it could be ".php" or ".asp" page! which might have advantages) looks at the query string and figures out what file to load and play.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
low tech (02-13-2013)