title: How to encode periods for URLs in Javascript?
body: <p>The SO post below is comprehensive, but all three methods described fail to encode for periods.</p>
  
  <p>Post: <a href="https://stackoverflow.com/questions/332872/how-to-encode-a-url-in-javascript">Encode URL in JavaScript?</a></p>
  
  <p>For instance, if I run the three methods (i.e., escape, encodeURI, encodeURIComponent), none of them encode periods.</p>
  
  <p>So "food.store" comes out as "food.store," which breaks the URL.  It breaks the URL because the Rails app cannot recognize the URL as valid and displays the 404 error page.  Perhaps it's a configuration mistake in the Rails routes file?</p>
  
  <p>What's the best way to encode periods with Javascript for URLs?</p>