That sounds like it will work in principle to me, and we do have some JS examples in the FMOD Engine - HTML5 download on our downloads page, where you can check sample code there.
For more information, you could also have a look at a similar post here:
Hope this helps, let me know if you have any questions.