 <p>You need to use encodeURIComponent to do this.</p> <pre><code>encodeURIComponent('http://example.com/feed.xml&amp;0.1234') </code></pre> <p>will result in</p> <pre><code>http%3A%2F%2Fexample.com%2Ffeed.xml%260.1234 </code></pre> <p>and when appended to the end result you'll get</p> <pre><code>https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;num=5&amp;q=http%3A%2F%2Fexample.com%2Ffeed.xml%260.1234 </code></pre>