0

Good day,

I need to check if a website has loaded completed, including AJAX.

For all other frameworks I found a way to verify it, except for A4J.AJAX.

// DOM
document.readyState=='complete';
// jQuery
jQuery.active==0;
// Ajax
Ajax.activeRequestCount==0;
req.readyState==4;
// Dojo
dojo._inFlightCount==0;
// A4J???
...

Is there a similar way for A4J to determine its readiness? I googled about it but had no success. I cannot use a finished method of A4J because I would like to use a javascript variable that has the boolean true or false to evaluate if the page's ajax has finished loading.

Thanks :)

MushyPeas
  • 2,469
  • 2
  • 31
  • 48
  • What do you mean by "has loaded completely"? The DOM, all linked resources? Ajax requests are quite independent, so why would you include them into "page loading"? – Bergi Nov 07 '12 at 14:04
  • I want to know when this content change has finished. If it's still changing parts of the site, the site is not loadeded. As you see in my example all other big frameworks offer a way to determine this. – MushyPeas Nov 07 '12 at 14:19
  • But the site could change again and again, somewhen in the future - you never have a "finished" state as long the page is interactive. You really will have to hook on the ajax callback - show us the relevant parts of your code, please – Bergi Nov 07 '12 at 14:44
  • i cannot provide the code, it is simply a javascript function executing the commands in my question and creating a boolean of true and false. Only the command for A4J is missing, but if this framework does not offer this simple feature, we will need to switch frameworks. This all is part of a testautomation framework. Before i can control an ajax listfield, it must be fully loaded and filled. – MushyPeas Nov 07 '12 at 15:18
  • You might take a look at http://stackoverflow.com/questions/13166176 – slashingweapon Nov 07 '12 at 15:59
  • thx, but this is only for jQuery ie. dojo requests are not included :( – MushyPeas Nov 07 '12 at 16:23
  • @CreeTar: Ah, so you want to control a list field after it was filled by Ajax. Please show us the code that loads that list field, then – Bergi Nov 07 '12 at 19:01
  • @Bergi sorry i cannot show the code, it is very complex, I already went through it but could not find a way to determine when its loaded. Now i check for the loading "throbber", it works so far but its not really a good generic way. I work for a big automobile company, thats why i cannot post code here. I continued to google about it and it seems there is no way to determine it with a simple attribute as in Dojo or JQuery :( – MushyPeas Nov 07 '12 at 19:17

0 Answers0