You cannot play The Sims 3 purely online in a browser—it is a PC game that must be installed from the disc or a legitimate digital download.
If a friend owns the game, borrowing the disc to install it can work, but the cleanest and most reliable approach is to purchase your own copy through an official storefront.