Uncaught SyntaxError: Unexpected identifier
<p>It seems I have found myself yet again in quite of a pickle. From what I understood via searching this issue was that if <code>var</code> is <code>int</code>, this error might occur. But as far as my amateur Javascript skills go, I did not detect such a thing in my completely <a href="http://blog.alexmaccaw.com/svbtle-image-uploading" rel="nofollow">stolen code</a>.</p>

<pre><code>var createAttachment = function(file) {
    var uid  = [guava_uid, (new Date).getTime(), 'raw'].join('-');

    var data = new FormData();

    data.append('attachment[name]', file.name);
    data.append('attachment[file]', file);
    data.append('attachment[uid]',  uid);

    $.ajax({
      url: '/attachments',
      data: data,
      cache: false,
      contentType: false,
      processData: false,
      type: 'POST',
    }).error(function(){
      console.log('could not upload');
    });

    var absText = '![' file.name + '](/attachments/' + uid + ')'; // &lt;&lt;&lt; ERROR
    $('#editor textarea').insertAtCaret(absText);
};
</code></pre>

<p><code>guava_uid</code> is defined before any of the code above as <code>guava_uid = "1";</code>, I tried it as <code>guava_uid = 1;</code> as well, but same result. All help is, as usual, appreciated. </p>
