Title: [Plugin: Contact Form 7] Proper JavaScript Embedding Patch
Last modified: August 19, 2016

---

# [Plugin: Contact Form 7] Proper JavaScript Embedding Patch

 *  [yuletide](https://wordpress.org/support/users/yuletide/)
 * (@yuletide)
 * [17 years ago](https://wordpress.org/support/topic/plugin-contact-form-7-proper-javascript-embedding-patch/)
 * Here are the diffs for the necessary modification to allow the contact form 7
   scripts to be relocated by other plugins (such as footer-js) or whatever. In 
   other words, the proper way to embed JavaScript from a plugin… Especially since
   this script depends on JQuery!
 *     ```
       Index: /contact-form-7/wp-contact-form-7.php
       ===================================================================
       --- /plugins/contact-form-7/wp-contact-form-7.php	(revision 117548)
       +++ /plugins/contact-form-7/wp-contact-form-7.php	(working copy)
       @@ -693,7 +693,6 @@
        };
        //]]>
        </script>
       -<script type='text/javascript' src='<?php echo $javascript_url; ?>'></script>
        <?php
        		}
        	}
       @@ -1179,8 +1178,9 @@
        		}
   
        		$javascript_url = WPCF7_PLUGIN_URL . '/contact-form-7.js';
       +		wp_enqueue_script('wp-contact-form-7',$javascript_url,array('jquery'));
        ?>
       -<script type='text/javascript' src='<?php echo $javascript_url; ?>'></script>
       +
        <?php
        	}
       ```
   
 * [http://wordpress.org/extend/plugins/contact-form-7/](http://wordpress.org/extend/plugins/contact-form-7/)

Viewing 1 replies (of 1 total)

 *  [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [17 years ago](https://wordpress.org/support/topic/plugin-contact-form-7-proper-javascript-embedding-patch/#post-1077531)
 * Thanks. It will be supported in the next release.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Contact Form 7] Proper JavaScript Embedding Patch’ is closed
to new replies.

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/plugin-contact-form-7-proper-javascript-embedding-patch/#post-1077531)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
