Title: Javascript error
Last modified: August 22, 2016

---

# Javascript error

 *  [Grégory Viguier](https://wordpress.org/support/users/greglone/)
 * (@greglone)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-error-68/)
 * Hi.
 * Depending on the situation or the browser, a “$.wpcf7SupportHtml5 is not a function”
   error is triggered in `includes/js/scripts.js` (yes, jQuery is loaded before).
 * Fix: move this part at the end of the file, rather than the beginning:
 *     ```
       $(function() {
       	_wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
       	$('div.wpcf7 > form').wpcf7InitForm();
       });
       ```
   
 * Thanks.
    Greg
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Grégory Viguier](https://wordpress.org/support/users/greglone/)
 * (@greglone)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-error-68/#post-5601176)
 * Hu, resolved? Did I unintentionally do that, or did [@takayuki](https://wordpress.org/support/users/takayuki/)
   Miyoshi passed by?
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-error-68/#post-5601234)
 * Sorry, I thought you have fixed it by yourself.
 * Normally such issues aren’t seen. Try switching to the default theme and deactivating
   all other plugins to rule out cases of other theme/plugin interfering.
 *  Thread Starter [Grégory Viguier](https://wordpress.org/support/users/greglone/)
 * (@greglone)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-error-68/#post-5601257)
 * 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](https://github.com/getify/LABjs).
   But on certain circumstances I have an error.
 * I made some more tests, and for example on [my contact page](http://www.screenfeed.fr/contact/),
   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 🙂
 *  [paulvanbuuren](https://wordpress.org/support/users/paulvanbuuren/)
 * (@paulvanbuuren)
 * [11 years ago](https://wordpress.org/support/topic/javascript-error-68/#post-5601360)
 * Where can I up-vote this solution?
    🙂
 *  [timholz](https://wordpress.org/support/users/timholz/)
 * (@timholz)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-68/#post-5601363)
 * Hi
    Thank you very much for sharing. Works very well. No more error in ie8. regards
   theo
 *  [webskripti satya](https://wordpress.org/support/users/satya_wp/)
 * (@satya_wp)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-68/#post-5601376)
 * I am getting unexpected token > error. How Can i resolve this? I am getting this
   error on includes/js/scripts.js
 * var e = $(‘<div class=”ajax-error”></div>’).text(error.message);
 * Can any one help me? please..

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Javascript error’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 6 replies
 * 5 participants
 * Last reply from: [webskripti satya](https://wordpress.org/support/users/satya_wp/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-68/#post-5601376)
 * Status: not resolved