Hello I do have data which needs to be refreshed every 5 seconds but I can't retrieve the value after the refresh. I've tried this:
First, I've used the refresh function:

```js
$(document).ready(function(){
    $('#div_refresh').load("userdetail.html");
        setInterval(function(){
            $('#div_refresh').load("userdetail.html")
}, 5000);
});
```

This it is loading + refreshing my DIV, as per the HTML (userdetail.html)

```html
<html>
<p>Username: <span id="Name"></span></br>
    Routing Profile: <span id="routingProfile"></span></br>
    Agent State: <span id="State"></span></br>
    State TimeStamp: <span id="TimeStamp"></span></br>
    State Duration: <span id="Duration"></span></p>
</html>

```

This is working, DIV it is refreshing, however, after the first refresh all data that it is being populated through the script:

```js
    /* agent.js */
        connect.agent(function(agent) {
            document.getElementById("Name").innerHTML = agent.getName();
            document.getElementById("routingProfile").innerHTML = agent.getRoutingProfile().name;
            document.getElementById("State").innerHTML= agent.getState().name;
            document.getElementById("TimeStamp").innerHTML = agent.getState().startTimestamp;
            document.getElementById("Duration").innerHTML = agent.getStateDuration();
        });

```

No longer appears, it just returns the paragraph within the names, but the 'span' value doesn't.
On my main HTML (index.html) this is how the setup it is set:

```html
 <div id="div_refresh"></div>
 <script id="agent" type="text/javascript" src="./agent.js"></script>
 <script src="./reload.js"></script>

```

This is how it looks like before the refresh and the span data disapear
<https://iili.io/c6p8pS.png>
Any ideas?