Title: How to include another javascript
Last modified: August 22, 2016

---

# How to include another javascript

 *  Resolved [krohmi](https://wordpress.org/support/users/krohmi/)
 * (@krohmi)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/how-to-include-another-javascript/)
 * Hello, first things first, very nice and usefull plugin.
 * And question is:
    How can i include script with my own functions. For example
   to read value of field and display it or add to href link.
 * When i include separate js file i got error: “Uncaught ReferenceError: [eg. class}
   is not defined”. How can i properly include another js to read values from fields.
   Any tips would be usefull.
 * Thx
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/how-to-include-another-javascript/#post-5407558)
 * Hi,
 * To include a new javascript file, you simply should upload it in the following
   location:
 * /wp-content/plugins/calculated-fields-form/js/fields-public
 * The plugin includes dynamically in the public webpage, all javascript files of
   this directory.
 * Best regards.
 *  Thread Starter [krohmi](https://wordpress.org/support/users/krohmi/)
 * (@krohmi)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/how-to-include-another-javascript/#post-5407561)
 * That was blazzing fast 🙂
    But have some more questions… I placed js file in 
   that location, js included well (i checked by placing alert box for testing).
   But when i trying to target fields nothing happens.
 * Just one line of code:
    jQuery(‘.className’).hide();
 * No offect…
 *  Thread Starter [krohmi](https://wordpress.org/support/users/krohmi/)
 * (@krohmi)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/how-to-include-another-javascript/#post-5407569)
 * Found a solution, just adding:
    `$(document).ready(function()` do the trick.

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

The topic ‘How to include another javascript’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [krohmi](https://wordpress.org/support/users/krohmi/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/how-to-include-another-javascript/#post-5407569)
 * Status: resolved