theovenbird
theovenbird

Reputation: 334

Trouble with Autolinker.js: Cannot read property 'assign' of undefined

I'm using Greg Jacob's Autolinker.js on a twitter API call. No matter where I place my code Autolinker.link() code I can't seem to get it to work. I've tried passing it just a string variable and the more defined document...innerHTML and neither seem to work. Here's my code as it stands now:

<blockquote id="tweets"></blockquote>

<script src="Autolinker.js"></script>
<script>
    // API Call

    function tweetsApi( data ) {
        var tweets = data.statuses.length;
        var n = Math.floor(Math.random() * ((tweets - 1) - 0 + 1)) + 0;
        var string = data.statuses[n].text + other twitter data;
        document.getElementById("tweets").innerHTML = string;
        document.getElementById("tweets").innerHTML = Autolinker.link(document.getElementById("tweets").innerHTML);
    }
</script>

Shouldn't the data be defined by the time Autolinker.js picks it up?

Upvotes: 0

Views: 411

Answers (1)

theovenbird
theovenbird

Reputation: 334

Odd, but using the minified version of the code fixed the problem.

Upvotes: 1

Related Questions