With javascript how can I add a query string parameter to the url if not present or if it present, update the current value? I am using jquery for my client side development
If it's not set or want to update with a new value you can use:
window.location.search = 'param=value'; // or param=new_value
This is in simple Javascript, by the way.
EDIT
You may want to try using the jquery query-object plugin
window.location.search = jQuery.query.set("param", 5);