Created
May 4, 2010 17:42
-
-
Save leandroh/389713 to your computer and use it in GitHub Desktop.
simple query string parser based on element id and value
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 queryString = { | |
createById: function() { | |
var args = []; | |
for (var i = 0; i < arguments.length; i++) { | |
var el = document.getElementById(arguments[i]); | |
args[i] = el.id + "=" + el.value; | |
} | |
return args.join("&"); | |
} | |
}; | |
queryString.createById('firstId', 'secondId', 'thirdId'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment