The present invention relates to an electronic ballast for a fluorescent lamp and an energy-saving lamp. A multi-function module MK circuit is added to the electronic ballast which is based on a half-bridge inverter circuit. The multi-function module MK circuit, which is connected between a positive node A and negative node B of a power supply of a rectifier filter circuit and an upper and a lower bridge of two power tubes, has functions of preventing the upper and lower bridge from being on at the same time, stating preheating, over current and short-circuit protection. Although the cost is increased, the electronic ballast can be a new generation half-bridge inverter circuit electronic ballast which has long use life, relatively low cost, sufficient output power and has the functions of electronic preheating, over current and short-circuit protection. The invention helps to promote and popularize split type energy-saving lamps, end the situation that previous fluorescent lamps and energy-saving lamps save energy without saving money, and further helps to reduce the emission of carbon dioxide and the environment pollution caused by mercury.