Ajax is stuck

Status
Not open for further replies.
I think it's a cache problem. Sometime the form run fine and sometime it doesn't. Same value typed in the same element will stuck the ajax option and after i press Ctrl+F5 for several times, it will run fine..

Rob, you can test it in my website,i use the default template with no javascript/validation applied to this element (the list is available only for Super Users, in section "My Site" you will find the login data). See here , maybe you can understand what happen. Select any value from dropwdown and type any letter in cdd and pick a value. In my case, the first test do run fine, then something happen and ajax is stuck. Using Ctrl+F5 will solve the problem for few more tries then is stuck again.
 
Sorry for the delay coming back - The problem is still there - I have updated yesterday

Is there any advice please how to fix?

Thanks
 
I am sorry Mark - I did a LOT of work on form.js which included a fix for this, but in the end it was a lot of fixes in one big PR and Rob / Hugh could not understand it - and now the base code has moved on and it will take a lot of time to unpick the changes I did and submit them in smaller chunks and I don't have time for this at present.

Sorry!
 
Hi Rob

I have tried the page with and without the javascript but the error remains - is there anyway way I can fix this that you may be able to help with?

Thanks

Mark
 
I have just noticed the following

if I type in just the first 1 or 2 letters of the name then it work ok, as soon as I go past this it sticks

Also when it is stuck, if i refresh the page it works fine but if i try to check another name the same happens - Any ideas?

Thanks
 
can you add the site to 'your site's so I can ftp up and edit the code there to test please?
 
Thanks rob - I have added to my sites previously (lettingagentsupportklub.co.uk/j3) but if that is now working then I'll have do it in the morning as I'm not in front if my pc at the moment

Thanks and regards

Mark


Sent via my iPhone using Tapatalk app
 
you still have a js error in your custom JS!

I've changed it to .......
Code:
var check_landlord = document.getElementById('___Check_A_Landlord_Performance');
var reputation = check_landlord.getElementsByTagName('div');
 
if (check_landlord.getElementsByTagName('img')[0]) {
    var img = check_landlord.getElementsByTagName('img')[0];
} else {
    var img = document.createElement("img");
}
if (reputation.length !== 0) {
  reputation[0].style.display = 'none';
  if (reputation[0].innerHTML == 'Good') {
      img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/good.png";
  } else if (reputation[0].innerHTML == 'New') {
      img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/new.png";
  } else if (reputation[0].innerHTML == 'Problematic') {
      img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/problematic.png";
  }
}
 
 
check_landlord.appendChild(img);
Now that no js error occurs I can't see the issue.
I could see the issue on the demo site you posted, which was the site I was asking for access to. - can you add that one please?
 
Morning Rob and thanks for taking the time

If you login here using demo as username and password

http://www.lettingagentsupportklub.co.uk/j3/

Then go here to see the problem

http://www.lettingagentsupportklub.co.uk/j3/members-area/landlord-area/check-a-landlord

If you type in just ma and select mark reynolds it works

If you type in mark and select mark reynolds it doesn't

Sorry for the delay, I never received an email alert but I probably missed it as things are very hectic at the moment

Thanks again

Mark
 
Hi Mark, just jumping in to say I can confirm the issue on your site and mine. It happens frequently but not sure if it is the number of letters or how quickly they are entered. I don't have any custom JS, it is just an autocomplete dbjoin. I hope this can be resolved!
 
Hi Mark, just jumping in to say I can confirm the issue on your site and mine. It happens frequently but not sure if it is the number of letters or how quickly they are entered. I don't have any custom JS, it is just an autocomplete dbjoin. I hope this can be resolved!

Hi Rackem, I have just tried typing the name in slowly and it works fine, so it MAY be something to do with the speed of typing in the name? - Can you message me your url so I can see the problem on your site please?

Thanks
 
Sorry Mark, the form that was giving me grief is behind an admin login. Interestingly enough, that dbjoin autocomplete seemed to be working better today whether I typed fast or slow. Not sure if it had anything to do with it but it used to have a Concat statement like the following:

first_plus_nickname, ' ', last_name, ' ', sex

Which Rob changed to (for an unrelated issue)

IF(first_plus_nickname <> '', CONCAT(first_plus_nickname, ' '), ''), IF(last_name <> '', CONCAT(last_name, ' '), ''), sex

So, I don't suggest changing anything but maybe it has something to do with a Concat statement - are you using Concat? Or perhaps a recent GitHub has affected things for the better.

I will continue to monitor things and report if any clues arise.
 
Can you try this for me ... in ./media/com_fabrik/js/autocomplete-bootstrap.js, around line 83 should be this code:

Code:
    Fabrik.loader.start(this.getInputElement());
    if (this.ajax) {
        this.closeMenu();
        this.ajax.cancel();
    }
Try changing that to:
Code:
    if (this.ajax) {
        this.closeMenu();
        this.ajax.cancel();
    }
    else {
        Fabrik.loader.start(this.getInputElement());
     }
I think the problem is simply that we're opening multiple load spinners (well, internally we increment a count, rather than actually opening more than one). We are correctly killing off the last AJAX request if we get another character typed before the last AJAX callreturns, but we're opening another load spinner regardless. Then when the last AJAX completes, we're only closing one of them (or rather, decrementing the count, and thinking we should should still keep it open as the count isn't 0).
The above change should mean that we only open the spinner if there isn't already one open.
You'll need to be in Fabrik debug mode to get the uncompressed JS files, or have JS Debug enabled, under debugging options tab in main Options, button top right of any backend Fabrik page.
-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top