If you want to embed a gallery with Javascript code, you can use following code:
This could be useful if you want to programmatically embed the gallery, for eg. you can create a script that will detect a user scrolling and embed the gallery only after the user has scrolled to a certain position on the page.