Unable to detect any parameter in html (webresource) when value is passed from onload method of form
I am trying out some stuff. For which I created a simple Entity. In the form of the entity I have added a simple web resource (html). And for the onload of the form I am calling the following function
function HelpDeskActivityOnLoadhandler()
{
var customParameters = encodeURIComponent("first=First Value&second=Second Value&third=Third Value");
Xrm.Utility.openWebResource("tsi_scriptzz",customParameters);
}
Here is the code for the tsi_scriptzz.html
<html>
<body>
<script type="text/javascript">
var vals = new Array();
if (location.search != "") {
vals = location.search.substr(1).split("&");
for (var i in vals) {
vals[i] = vals[i].replace(/\+/g, " ").split("=");
}
}
</script>
</body>
</html>
MY PROBLEM IS -> location.search is always coming back with empty string. So, it not getting the parametrs I am passing from the load method of the form.
Could someone kindly help me.
Thanks,
Hasib