Please, help me to understand the following part of the code from the post http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit/133997#133997
function post_to_url(path, params, method) {
....
for(var key in params) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
....
Does this mean that we could pass the Dictionary
object to the JavaScript function (calling JavaScript function from Silverlight app) and it will generate the param string in the form of key=value&key2=value2&key3=value3
?
For example, passing the following Dictionary:
Dictionary<string, decimal> postdata = new Dictionary<string, decimal>();
postdata["productID1"] = 126504;
postdata["productID2"] = 126505;
We get the function output: productId1=126504&productId2=126505
?