Update 2014-04-29: Check out Turf, looks really promising
JSTS can do unions of geometric objects in the browser. JSTS integrates with the openlayers library and it extends openlayers geometric classes (e.g. OpenLayers.Geometry.Polygon) so they are capable of geometric operations. Example:
>> var poly1 = OpenLayers.Geometry.Polygon.createRegularPolygon(
new OpenLayers.Geometry.Point(0.0,0.0), 2, 5);
>> var poly2 = OpenLayers.Geometry.Polygon.createRegularPolygon(
new OpenLayers.Geometry.Point(1.0,1.0), 2, 4);
>> var poly_u = poly1.union(poly2);
>> var poly_d = poly1.difference(poly2);
>> print(poly_u);
POLYGON((1.5667154718422638 -0.4142135623730949,1.1755705045849463 -1.618033988749895,
-1.1755705045849465 -1.6180339887498947,-1.902113032590307 0.618033988749895,
-0.41421356237309503 1.6990562312593451,-0.4142135623730949 2.414213562373095,
2.414213562373095 2.414213562373095,2.414213562373095 -0.4142135623730949,
1.5667154718422638 -0.4142135623730949))
Geoscript JS is nice if you want to do serverside geometric operations in JS.