C#,vb.net,MVC,Jquery,javascript,jscript,vbscript,html,vb,sharepoint,COM,WPF,WCF,Wwf,Asp,Asp.net,questions & answers,

Latest in Sports

Wednesday, December 31, 2014

Issue in Javascript function when called from XSLT in IE browser

In IE browser, We are facing an issue where JavaScript function when gets called from XSLT returns incomplete JavaScript parameters. However if the same JavaScript function when gets called through the C# code then it returns the complete JavaScript parameters.
 
Please note this anomalous behavior is observed when we have JavaScript parameter having character limit crossing 4000 chars. For parameter having lesser characters are working fine in both the cases mentioned above.
 
Please note that we are able to get the parameters in the XSLT variables. But the issue occurs when we try to pass the XSLT variables in javascript function.
 
e.g.Suppose we have to pass 5 parameters, then
In Internet Explorer browser, javascript function is truncating in between:
javascript:showAlertMessage('<div> Content exceeding 4000 characters<div>', 'Var2','Var3','var4   {var 4 is truncating in between}
 
But in Non-IE browsers, it is passing all parameters successfully:
javascript: showAlertMessage('<div> Content exceeding 4000 characters<div>', 'Var2','Var3', 'Var4', 'Var5');
 
Early help would be highly appreciated.



SOLUTION 1:

Generally we are using below way to call the JavaScript in XSLT.
 
         <script type="text/ecmascript">
            formatDt('param1',’aparam2’);
          </script>
 
Hope that helps you.

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete