title: Getting Website URL using JS not working with https
body: <p>I'm using this JS code to get the page url, title and send them to the server to store them in a database, like a button you bookmarked in your browser toolbar and click it on any website you have open and it will get the website's URL and TITLE.</p>
  
  <p>However this code is working great BUT it's not working with (https) url</p>
  
  <pre><code>javascript:(function(){var jsScript=document.createElement('script');
  jsScript.setAttribute('type','text/javascript');
  jsScript.setAttribute('src', 'bookmark.php?url='+encodeURIComponent(location.href)+'&amp;amp;title='+encodeURIComponent(document.title));
  document.getElementsByTagName('head')[0].appendChild(jsScript);
  })();
  </code></pre>
  
  <p>It's working good with all url's Except (https) links like<br />
  <a href="https://facebook.com" rel="nofollow">https://facebook.com</a> <br />
  <a href="https://google.com" rel="nofollow">https://google.com</a><br /></p>
  
  <p>It's not working at all with these kind of links.</p>
  
  <p>Any improvements that could make it work with https links? </p>
  
  <p>Thanks in advance. </p>