Javascript solution for embed