I have this:
var searchString = action + ? + 'search=' + search + '&filter='
the action variable could either already have a ?parameter or could not have one.
therefore I need to test action if it already contains a ? and if so append &search. Otherwise I need to use ?search
Any idea how to solve that in an easy manner?
Or you can use the jquery Query Plug-in http://plugins.jquery.com/project/query-object