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 UrlHelper = function (location) { | |
this.protocol = ''; | |
this.host = ''; | |
this.path = ''; | |
this.queryValues = {}; | |
this.initQueryValues = function (search) { | |
var vals = {}; | |
if (search) { |
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
// Performs a synchronous post that changes json to .Net consumable post fields | |
// this will send the page to the path specified as if it was a normal form post | |
function postToDotNet(path, params) { | |
var form = document.createElement("form"), | |
createFields = function (data, fieldPrefix) { | |
if (fieldPrefix === undefined) fieldPrefix = ''; | |
if (Array.isArray(data)) { | |
for (var i = 0; i < data.length; i++) { | |
createFields(data[i], fieldPrefix + '[' + i + ']'); | |
} |