Created
June 23, 2017 00:26
-
-
Save shrimp2t/0088ae1c3f0c0e03b69a63b26b723842 to your computer and use it in GitHub Desktop.
Add params to URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var addParams = function( url, data ) | |
{ | |
if ( ! $.isEmptyObject(data) ) | |
{ | |
url += ( url.indexOf('?') >= 0 ? '&' : '?' ) + $.param(data); | |
} | |
return url; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment