The following JavaScript statement loads the MIDI file
tune.mid to the default user system application for processing and/or playing MIDI files:
location.href='tune.mid';
This statement can easily be used in a hypertext link:
<a href="javascript:location.href='tune.mid';">Play MIDI Tune</a>
The following example provides a form with a button for activating the same statement through onclick():
<form> <input type="button" value="Play MIDI Tune" onclick="location.href='tune.mid';" /> </form>
Working example:
Thanks to Suzanne Rhatigan for preparing this little tune.
JavaScript Application: MIDI Player • © 2025 Manfred Baumeister • Updated: 29 October 2008, 14:15:02 GMT
|