Ajax Bug in CF7 that affects Safari v9 and older
-
WPCF7 uses FormData in order to send requests in Ajax format. We had a problem with Ajax requests not working in Safari version 9.1 (El Capitan) and lower (tested down to Mavericks Safari 7.1). CanIUse states that FormData is fully supported since Safari 7.1. However, the Ajax was still failing in WPCF7 in these versions. After some digging, I have found out the following snippet located in
wpcf7.initForm
andwpcf7.submit
functions:if ( typeof window.FormData !== 'function' ) { return; }
It was a weird error that the function only returned only in Safari <=9.1. I have found out that,
typeof window.FormData
isfunction
in Safari >= 10 while in Safari <=9.1, it is equal toobject
. A possible fix that I have implemented for our website was the following:if ( typeof window.FormData === 'undefined' ) { return; }
Could you please solve this problem; so that, it works in older versions of Safari.
- The topic ‘Ajax Bug in CF7 that affects Safari v9 and older’ is closed to new replies.