LiveAPI via Javascript objects

I’m familiar with java in Max and some Javascript. Is there a simple way to control Live using Javascript commands (and that uses the same syntax as the patcher objects) – so e.g. play track 1, clip 2?

I looked at the LiveAPI javscript object page in help, but I couldn’t see if it is a particular object or if I write my own javascript file?

Also, here is the code (from example at the bottom of help page), which didn’t yet work for me. If you have a working example, that would be great.