I want to sent 2 parameters from the client ( jquery ) side to server side ( php-codeigniter ). The parameters are id ( an integer ) and text ( a string ). I tried:
window.location.href="AjaxUpdate/sendMessage/"+id+"/"+text;
which has worked for me in the past using only the id, but because the text string can have spaces I can get:
http://localhost/b1/mycontroller/myfunction/3/gdfgdgd%20 %20 gd
which gives:
An Error Was Encountered
The URI you submitted has disallowed characters.
What is the best way to prepare and transmit a string to the server side using jquery? I assume ajax will be used in some way