The ion orbit loss flux at the plasma edge is calculated, including the squeezing factor. A bifurcation solution is found by balancing the ion loss flux and the anomalous electron flux. At a certain level of anomalous electron flux, the plasma poloidal rotation increases with ion temperature. When the fluctuations are suppressed and the electron confinement is improved, the radial electric field and its shear can increase appreciably at the same ion temperature. The squeezing factor plays an essential role in the L-H mode transition. More negative electric fields and more negative electric shear diminish the anomalous fluxes. The whole picture is in agreement with experimental signatures during the transition