DEV Community

Discussion on: JavaScript Functions That Will Make Your Life Much Easier [Updatable].

Collapse
 
mma1979 profile image
Mohammed Abdelhay

and this one I am using regularly

// serialize javascript object into url query string
        Serialize = function (obj) {
            var str = [];
            for (var p in obj)
                if (obj.hasOwnProperty(p) && obj[p] != null && obj[p].toString() != '') {
                    str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
                }
            return str.join("&");
        }

Enter fullscreen mode Exit fullscreen mode
Collapse
 
youssefzidan profile image
Youssef Zidan

Nice!
I like it!