So I have the following html code:

```
<div> 
<script type="text/javascript" src="https://app.ecwid.com/script.js?4549118"></script> 
<script type="text/javascript"> xMinicart("style=","layout=Mini"); </script> 
</div>

```

Please take a look at the actual code run in the browser. It shows a link.

I want to add the link to an navigation bar with the following code:

```
<script>
window.onload=function(){
 $('nav ul').append('<li><a onClick="test()" href="javascript:void(0);">Link 3</a></li>');
}
</script>

```

But I'm not managing to add the code within the append correctly. How do I reference the js source and call the xMinicart function within the append code?

Thanks a lot!

**super important update!**

It's almost there! the following javascript code does work in jsfiddle but it doesn't work in squarespace. I'm not sure why.

```
$('nav ul').append('<li id="hello">test</li>');

$.getScript("https://app.ecwid.com/script.js?4549118", function(){
    xMinicart("style=","layout=Mini","id=hello");
});

```

You can see it working here: <http://jsfiddle.net/u3NKD/8/>