I am trying to change the line
var url = window.location.href;
to point to an API which can get a shorted Link of the actual Page.
My idea was to set it by this way
var url = 'http://bit.ly/api.php?url=' . urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
and send this to Twitter
var twit = 'http://twitter.com/home?status='+title+'%20'+url;
Get the report that i have a Syntax Error but dont know which one.
+not.urlencodeis a PHP function, you wantencodeURIComponent$_SERVERis a PHP superglobal, you still wantlocation.hrefSuch: