Using PHP inside Javascript? To shrink URL
<p>I made a bitly url shrinker, and I currently have a Soundcloud Javascript API that outputs a url link of a song. Im trying to shrink it using my shrinker. The shrinker works using this:</p>

<pre><code>&lt;?php echo $bitly-&gt;shorten('http://google.com'); ?&gt; //Equals google.com in short url format
</code></pre>

<p>The javascript code I'm trying to implement it in is this: Ill go ahead and give you what I tried to do already, that didn't work. </p>

<p>Before I edited:</p>

<pre><code> container.find('span.player-actions').html(
                '&lt;a href="' + track.user.permalink_url + '" target="_blank"&gt;Soundcloud&lt;/a&gt; | &lt;a href="' + track.permalink_url + '/download" target="_blank"&gt;Download&lt;/a&gt;'
        );
</code></pre>

<p>After I tried:</p>

<pre><code>container.find('span.player-actions').html(
                '&lt;a href="' +  &lt;?php echo $bitly-&gt;shorten('track.user.permalink_url'); ?&gt; + '" target="_blank"&gt;Soundcloud&lt;/a&gt; | &lt;a href="' + track.permalink_url + '/download" target="_blank"&gt;Download&lt;/a&gt;'
        );
</code></pre>

<p>Any suggestions, I'm open to anything. And would love to make this work! Thanks in advanced</p>
