In Ruby on Rails you can use to_query to convert a hash into a string suitable for use as a URL query string.
For example:
{ :name => 'David', :nationality => 'Danish' }.to_query # => "name=David&nationality=Danish"
Is there an equivalently easy way to do this in jQuery or javascript?