Question: This is my code

```
if (($handle = fopen("data.csv", "r")) !== FALSE) {

while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {

    echo "Title: $data[1]<BR>";
    echo "Time: $data[2]<BR>";
}
echo 'Results End. <hr>';
}

```

I want the horizontal line to appear after each result however it just appears after the last one. What am I missing?

Thanks

Answer: 
You can add `script` element and attach attributes such as `src` with `document.createElement` and place it to your DOM
You can use promises with getScript() and wait until all the scripts are loaded, something like:

```
$.when(
    $.getScript( "/mypath/myscript1.js" ),
    $.getScript( "/mypath/myscript2.js" ),
    $.getScript( "/mypath/myscript3.js" ),
    $.Deferred(function( deferred ){
        $( deferred.resolve );
    })
).done(function(){

    //do something

});

```