I need a way to insert the text downloaded from a .txt file from a URL into an element or variable which i can use further.

I have tried adding the URL to an object element which displays the text correctly, but I do not know how to add this text into a variable.

```
var storage = firebase.storage();
var storageRef = storage.ref();
var tangRef = storageRef.child('Recs');
var fileRef = tangRef.child("rec3.txt");

    fileRef.getDownloadURL().then(function(url)
    {
        alert(url);
        var para = document.getElementById('p1');
        var par = document.createElement("object");
        par.setAttribute('data', url);
        para.appendChild(par);

    }).catch(function(error) 
    {
        console.error(error);
    });

```