title: Userscript to change Links
body: <p>Im just trying to make a quick userscript to chnage a .com link into a .co.uk link, I looked at this question ( <a href="https://stackoverflow.com/questions/9520730/jquery-replacing-relative-links">jQuery replacing relative links</a> ) to try get some ideas and came up with this, but its not working. </p>
  
  <p>theres a link to the script as well as the script below, but i cant see what im doing wrong. I did try it beofre hand with </p>
  
  <pre><code>$(document).ready(function()
  </code></pre>
  
  <p>but didnt know if that was supported in userscripts, so ditched i, still no luck. </p>
  
  <p><a href="http://www.seriousbrew.co.uk/scripts/FreeBooksLinkReplace.user.js" rel="nofollow noreferrer">http://www.seriousbrew.co.uk/scripts/FreeBooksLinkReplace.user.js</a></p>
  
  <pre><code>// ==UserScript==
  // @name        Free Books Link Replace
  // @namespace   www.seriousbrew.co.uk/scripts/
  // @description one hundred freee books, changing links to .co.uk from .com
  // @include     http://onehundredfreebooks.com/ 
  // @version     2
  // ==/UserScript==
  
  
  function replacelinks() {
        $("a[href^='/']").each(function(){ 
        var cur_href = $(this).attr("href");
        var n=str.replace(/.com/gi, ".co.uk"); 
      });
  }
  
  replacelinks();
  </code></pre>