title: Javascript URL string adding %20 (space) after running grunt
body: <p><strong>TLDR;</strong></p>
  
  <p><strong>FIXED AS FOLLOWS</strong></p>
  
  <pre><code>selectedValue = selectedValue.replace(/\s+/g, '')
  </code></pre>
  
  <p>Thanks to: <strong><em>Richard Macarthy</em></strong> and <strong><em>Aaron Digulla</em></strong> for the answer, which led me down the poath to the correct answer.</p>
  
  <p>Just tp be clear, it seems Grunt was adding this whitespace for some reason. The fix is very simple...</p>
  
  <p><strong>ORIGINAL QUESTION</strong></p>
  
  <p>I have an JSON request, which get the contents of a JSON file to be used for data visualisations using d3.js.</p>
  
  <p>This all works fine locally, but when I run grunt build the URL string gets an <code>%20</code> injected into it from nowhere...</p>
  
  <p>Here is how the string looks before I run Grunt:</p>
  
  <pre><code>d3.json("json/wards-info/"+selectedValue+"-wards-data.json", function(error, newDatas) {
      newData = newDatas;
      newWardsData = newWardsDatas;
      drawMap(newData, newWardsData);
  });
  </code></pre>
  
  <p>Which computes to: </p>
  
  <pre><code>http://localhost:8080/app/json/wards-info/liverpool-ward-data.json
  </code></pre>
  
  <p>After I run Grunt build the computed URL string changes to:</p>
  
  <pre><code>http://localhost:8080/dist/json/wards-info/liverpool%20-ward-data.json
  </code></pre>
  
  <p>As you can see, it appears to be adding <code>%20</code> between <code>liverpool-ward</code></p>
  
  <p>Is this because of grunt, or due to something else?</p>