jQuery has a param()
function, I'm looking for similar functionality. I need to return a url in my object. For example:
url: function() {
return this.baseUrl + '?' + $.param({page: this.page, perPage: this.perPage});
},
this will return a url in the form of example.com/?page=1&perPage=5
or something similar. How can I form the url example.com/page/1/perpage/5
?