Here are a couple previous forum posts with tips on how to port a notebook to JavaScript:
and
Hopefully those provide a good starting point for you!