I am creating an R package which provides some helper functions to build a Shiny app.

One of the JS files packaged with the app needs to reference an image file. But I can't figure out how to reference it.

Currently, the js file is located in

> 
> my\_package/inst/www/js/my\_jsfile.js
> 
> 
> 

This file needs to reference

> 
> my\_package/inst/www/img/my\_img.gif
> 
> 
> 

In the JS file, what should the relative URL to the image be?

I tried various options, such as the following, which do not work, when launching in a Shiny app built with the package:

> 
> ../my\_img.gif
> 
> 
> www/img/my\_img.gif
> 
> 
> 

My JS looks like this:

```
function showRecordingIcon() {

  var img = document.createElement("img");
  img.style.display = "block";
  img.src =  "img/record.gif";
  img.width = "280";
  img.height = "280";
}

```

This was working before I packaged it.