The research about the interaction between grid environments and users is becoming popular. Many scientists propose the integration for Web 2.0 technologies and grid computing. In this paper, we propose a flexible Web-based framework for grid applications - WAGA, which tries to bridge the gap between grid middleware and grid applications. WAGA provides a WYSIWYG (what you see is what you get) way for the programming for grid applications by adopting participation, interaction and sharing features of Web 2.0 technology. With WAGA, a grid user is able to use the grid resources and to develop grid applications without understanding the underlying complexity of grids. WAGA is composed with a Web GUI (called WAGA-designer) and someWeb-based APIs. WAGA-designer is used by grid users to develop application-based Web portal, and the WebAPIs are used by the WAGA-designer. The use case study shows that WAGA is flexible for grid users, and the performance evaluation shows that WAGA works with high efficiency.