It's really unfortunate that JS won out in the web wars, another instance of the lowest common denominator winning out against technically superior options. If Microsoft hadn't been so evil, .NET is really a much better framework... but it didn't get enough traction.
By contrast, PHP has actually evolved quite gracefully over the last decade, incorporating more and more desired features into the baseline language. Sadly it has no browser clientside option.
Javascript is a victim of its own rapid success :(