# \[SOLVED\] Javascript in shortcodes

**URL:** <https://discourse.gohugo.io/t/solved-javascript-in-shortcodes/8346>\
**Category:** support\
**Created:** [September 12, 2017, 4:14pm UTC](https://discourse.gohugo.io/t/solved-javascript-in-shortcodes/8346 "2017-09-12T16:14:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yamila-moreno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/yamila-moreno/32/3823_2.png) [@yamila-moreno](https://discourse.gohugo.io/u/yamila-moreno)\
**Post date:** [September 12, 2017, 4:14pm UTC](https://discourse.gohugo.io/t/solved-javascript-in-shortcodes/8346/1 "2017-09-12T16:14:34Z")

</div>

Hi there, I’m trying to create a shortcode for galleria.js, but cannot get it running.

My shortcode is:

```auto
{{< flickr photoset_id="72157685132857311" >}}

```

in my `layouts/shortcodes/flickr.html` file, I’ve added:

```auto
<div class="galleria"></div>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.7/galleria.min.js"></script>

<script type="text/javascript">
  (function() {
      Galleria.loadTheme('https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.7/themes/classic/galleria.classic.min.js');
      Galleria.run('.galleria', {
        flickr: 'set:{{ .Get "photoset_id" }}',
        flickrOptions: {
          sort: 'date-posted-asc'
        }
      });
  });
    </script>

```

The problem, it doesn’t work. The HTML seems valids but it doesn’t show anything. I’ve tried with `| safeJS` ([JavaScript on page](https://discourse.gohugo.io/t/javascript-on-page/4166)) but still not working.

Thank you for your help! 😃

---

<div class="post-metadata">

**Author:** ![yamila-moreno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/yamila-moreno/32/3823_2.png) [@yamila-moreno](https://discourse.gohugo.io/u/yamila-moreno)\
**Post date:** [September 12, 2017, 4:47pm UTC](https://discourse.gohugo.io/t/solved-javascript-in-shortcodes/8346/2 "2017-09-12T16:47:06Z")

</div>

It was totally me!!

 should have a height to be displayed.

\o/
