var Core = { ModelControllerUrl: 'ModelController.rspx', CreateQueryString: function() { var key = ''; var value = ''; var queryString = '?'; var keyValueLength = 0; keyValueLength = arguments.length; //since this is a name value pair check if this is an even number if (keyValueLength % 2 != 0) { //TODO implement try catch throw logic alert('Error in creating Query String'); } else { for (var counter = 0; counter < keyValueLength; counter++) { //the first argument is the key if (counter % 2 == 0) { key = arguments[counter]; queryString += key + '='; } //second argument is the value else { //escape the value as it may contain special characters value = escape(arguments[counter]); queryString += value; //do not add the & at the end of the query string if (counter < keyValueLength - 1) { queryString += '&'; } } } return queryString; } } };
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)