<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script> <script> var chr = ' '; alert($.param(chr)); alert(encodeURIComponent(chr)); </script>