I want to find if the next value in a object exists or not, if it exists, add '&' else add nothing .
serializeForQueryString: function(obj) {
var queryString ='';
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
queryString=queryString+key+'='+ obj[key];
if (obj.hasOwnProperty(key)!=null){
queryString=queryString+'&';
}
alert(queryString);
}
}
//document.write(obj.name);
var queryString = '';
//jquery
//$.each(obj, function(key, value) {});
//$.isArray
return queryString;
},