Hi.
The problem doesn’t come from a third party plugin or the theme. Well, ok, kind of.
I try to defer my JavaScript files by using the library LABjs. But on certain circumstances I have an error.
I made some more tests, and for example on my contact page, the error seems to occur with IE8/9/10 (not in IE11, nor Firefox/Chrome/Safari, not tested with IE6/7): you’ll have the error message “Object doesn’t support property or method ‘wpcf7SupportHtml5′” in your console.
I admit I’m not sure if the problem is caused by the library itself, because your script is deferred, or simply because… IE.
Basically, what you do in your script:
_wpcf7.wpcf7SupportHtml5 = $.wpcf7SupportHtml5();
$.wpcf7SupportHtml5 = function() {
// whatever
};
To fix this problem is as simple as a cut/paste. Simply cut the following code from the beginning of your file:
$(function() {
_wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
$('div.wpcf7 > form').wpcf7InitForm();
});
and paste it at the end of the file, after $.wpcf7SupportHtml5 = function() { /*...*/ }
. I gave it a try and the problem was gone.
I agree this problem should not occur under normal circumstances since the file should be parsed first by the browser, then executed, and I don’t know why old versions of IE throw this error. Yeah, I know, “old versions of IE”, I guess we should not expect too much >_>
So, could you please fix this?
Thank you.
PS: a minified version of this script would be great ??