Wednesday, January 17, 2007 2:57 AM
by
bsandeman
InfoPath generated Javascript
It's been a while since my last posting, but I haven't been lazing about, what with having our first baby and all! She's gorgeous! Her name is Kayleigh.
Anyways, my most recent little thing is as follows....
We have our complex InfoPath form being hosted in MOSS and we have been going through system testing over the last couple of weeks. We have discovered that sometimes, clicking a button on the InfoPath form can take over 40 seconds before it actually starts doing anything, eg: click a button that copies a field from a secondary data source set to the main data source and change the view. It doesn't pop up with the "Sending to server" message until after 40 or so seconds.
However the interesting thing is that this only happens in Internet Explorer, if in Firefox then this takes an insignificant amount of time, eg: 1 second maybe....
After a bit of research and chatting with others I have discovered that IE has a much slower JS engine than Firefox, which is likely where the problem lies. I have tried to analyse the code that InfoPath has generated and the majority seems to be in the library file core.js. This file alone is over 750KB, therefore a truckload of code! The page itself which is a results page and contains about 30 rows of data, not much; is actually nearly 2MB in size! Which is huge for a web page!
After analysing the code I am struggling to understand why on earth they are doing what they are doing, it just seems utterly mad, that it has to execute around a hundred lines of code before it even gets anywhere near the actual functionality that the button will perform. This seems overly complex and is really where our problem lies, it would be much better if InfoPath auto-generated cleaner and more direct code.
If I find anything more out about this I will let you know....