Question: I have a directive which renders an image as a background image. It works great in Chrome and Safari (as far as I can tell) but seems to not work in Firefox (the background-images don't show up).
My research seems to indicate that maybe scope.$watch would help, but I'm not entirely sure how to apply it so that it will make things better. 

```
.directive('pictures', function () {
    return {
      restrict: 'EA',
      link: function (scope, element, attrs) {
       var url = attrs.pictures;
                element.css({
            'background-image': 'url(' + url +')',
            'background-size' : 'cover'
          });
      }
    };
  });

```

Help or direction would be greatly appreciated. Thank you.

Answer: 
When your `caller()` function runs, it calls the `call` function using `setInterval`, which will run on *ad infinitum*. 

Instead, change this:

```
setInterval(call, 1000);

```

To this:

```
setTimeout(call, 1000);

```

This only calls it once, after 1 second.
To open the popup once every time a user visits your page, you can use, i.e.:

```
<html>
 <head>
  your head
 </head>
  <body onload="popMe();">`
   your body
   <script>
   popMe(function(){ window.open('http://www.google.co.in'); }, 5000);
   </script>
  </body>
<html>

```