If your charging your T-Mobile G1 phone and you take the battery out does it stay on or does it turn off?

and im about to buy a G1 on craigslist but it doesnt have a battery and do you need to have a data plan for the g1 to work??