Added/fixed doc js sample code.