I am making a webpage so I can search google from a custom page. But when I click search it does search my input on google but the URL should be different when I input # and % and all these characters. So my question is how do I convert something like this :
http://www.google.com/#q=Hello World C#
to this :
http://www.google.com/#q=HEllo+world+C%23
using JavaScript
EDIT : This is the function I tried to use
$('button#SubmitSearch').click
(
function()
{
window.location = encodeURIComponent("https://www.google.nl/#q=" + $('input#SearchBar').val());
}
);
and
$('button#SubmitSearch').click
(
function()
{
window.location = "https://www.google.nl/#q=" + $('input#SearchBar').val();
}
);