Use browser interal functions instead of phpjs.org library