Ajax Sites

If you are creating an ajax driven site (meaning you are loading content via ajax requests and updating existing pages) there are a few things you should be aware of.

First and foremost, is that there is a lot going on under the hood of the IxF, as you can well imagine. We parse the page for specific classes and structure to do a lot of our default functionality. To do this we run a function called ixf.setup() when the page is done loading. This function in turn calls 4 additional setup functions who's names are hopefully fairly obvious: setupPanels(), setupGeneral(), setupPopups(), setupDataTables().

One thing to keep in mind is that ixf.setup() only runs once after the page is done loading. If you bring in any additional content via ajax to insert into the page, the logic that ixf.setup() has in it has not been run on that new content. You need to make sure to run ixf.setup() again after any ajax content has been added to the page that has need of it's services.

If you put in a paragraph of text, you likely don't need to run it again as there is nothing to parse and act upon. But if your content has datepickers, tables, selectboxes, popups, etc. (anything you haven't specifically written the code to setup) then make sure to run ixf.setup() again to give them the love they so richly deserve.

Using only parts of ixf.setup()

We have seen some projects try to be extra efficient and just run the part of the ixf.setup() that they feel they need. Maybe they just run the fixSelect script that they copied from within the setupGeneral(). It is understandable that they are wanting to be efficient by only running what is necessary. Currently the ixf.setup() takes between 50-250ms to run on a fairly complex 3 panel page. Which isn't that bad, and we will continue to strive to make that faster.

Every part of the ixf.setup() checks to see if things have already been run on a given match. So no code is run that isn't needed. If all you have is a select box that needs the fixSelect on it, that is all that is run.

Some issue we see by copying the content out of the setup functions are:

  1. The copied code can get outdated. Especially in the early releases of the IxF we are changing things regularly. By getting the newest ixf-utilities file you get the latest enhancements, bug fixes and optimizations. If you have copied chunks out, your copies may break or will not get updated.
  2. Your content gets additional stuff. The first time you only needed the fixSelect, but maybe now you need the datepicker. So you have to go back and copy stuff out again. Not to mention you now have custom code per ajax request. Maybe you have copied that fixSelect 10 times. This isn't very efficient.
  3. Wasted time. As hinted at above, this is a lot of effort for very little payoff. Save yourself the headache and just use the tools we have provided.

If you are really worried about the extra 200ms of time and you KNOW that your ajax will not have popups, tables or panels then you can call the setupGeneral() which takes care of most of the fixSelect, datepicker, etc type stuff. This way you get the benefit of our latest and greatest, but are able to cut out a few thing you know you won't use.

Text Size
Screen

My Account Sign Out