This paper presents online methods for controlling local bifurcations of power grids with the goal of increasing bifurcation values (i.e. increasing load margins) via network topology optimization, a low-cost control. In other words, this paper presents online methods for increasing power transfer capability subject to static stability limit via switching transmission line out/in (i.e. disconnecting a transmission line or connecting a transmission line). To illustrate the impact of network topology on local bifurcations, two common local bifurcations, i.e. saddle-node bifurcation and structure-induced bifurcation on small power grids with different network topologies are shown. A three-stage online control methodology of local bifurcations via network topology optimization is presented to delay local bifurcations of power grids. Online methods must meet the challenging requirements of online applications such as the speed requirement (in the order of minutes), accuracy requirement and robustness requirement. The effectiveness of the three-stage methodology for online applications is demonstrated on the IEEE 118-bus and a 1648-bus practical power systems.