Good day!

There is a code

$(document).ready(function() { $('#frload1').prop('action', '/Ajax/load_lenta_image') ; $('#photo_form').click(); }); 

The essence is the substitution of action in the form for ajax image upload (via iframe). On the desktop version and on Android, the code works fine, on IOS refuses.

BUT if before $('#frload1').prop('action', '/Ajax/load_lenta_image') ; add alert(1); , then the code is triggered after closing the notification.

Who faced what could be the problem?

  • one
    race condition? "on iOS refuses" - what is it expressed in? The little man gets out of the computer and says "I refuse!"? - Igor
  • Event does not work. Click without alert. - wstudiokiwi
  • Ta-a-ak. What does (should do) '#photo_form' on click? - Igor
  • #photo_form is the button that makes the submit form (the form has target - iframe, i.e. loading the image via ajax) - wstudiokiwi
  • We have with you too - race condition. Either you add a full description of the problem to your question, or I get tired of pushing you to it. - Igor

2 answers 2

Since the iframe is mentioned in the question, I put one hundred to one that it’s in the order of loading the page in the iframe and the parent page’s $(document).ready . Due to the lack of sufficient information, I can suggest using the onload handler of the iframe element.

What do you mean by race condition?

Suddenly, (for me it was unexpected) you need to add for #photo_form css property: cursor: pointer and click () starts working on iOS.

  • tried, to no avail - wstudiokiwi