Update client.js

Add open and close index