var ctx = SP.ClientContext.get_current();
var items = SP.ListOperation.Selection.getSelectedItems(ctx);
Bruce Ng's software development blog
An archive of solutions of programming problems I have faced in my career
var items = SP.ListOperation.Selection.getSelectedItems(ctx);