I see an line of our code base in JavaScript to construct a query string:
var queryParameters = "imagePath=" + encodeURIComponent(_image.source) + "&saveMode=" + saveMode + "&pageFolderId=" + pageFolderId + "&id=" + pageId + "&parent=" + parent;
queryParameters += "&quality=" + sQuality.value + "&commands=" + commandQueue.Serialize();
is there a better way to write this?
If you are using jQuery, you could just use an object representing your query string options:
jQuery will automatically encode the query string values, so you don’t need to call
encodeURIComponenton_image.source. See for more info: http://api.jquery.com/jQuery.param/