Title: JavaScript File Not Working
Last modified: August 21, 2016

---

# JavaScript File Not Working

 *  Resolved [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/)
 * I added a JavaScript jquery file to my theme and it is being called in the source
   of the page however not doing what it’s supposed to. I checked the code on JSFidde
   and it worked perfectly there.
 * Any ideas how to fix it?

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992885)
 * You need to be checking the browser’s console log for errors when developing 
   with JavaScript.
 *  Thread Starter [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992927)
 * The error I have with the file is “Uncaught TypeError: Property ‘$’ of object[
   object Object] is not a function ” so I looked that up and figured out I need
   to change
 *     ```
       $(document).ready(function () {
           var cw = $('.block-1').width();
       Uncaught TypeError: Property '$' of object [object Object] is not a function
           $('#block-me').css({
               'height': cw + 'px'
           });
       });
       ```
   
 * to
 *     ```
       jQuery(document).ready(function () {
           var cw = jQuery('.block-1').width();
       Uncaught TypeError: Property '$' of object [object Object] is not a function
           $('#block-me').css({
               'height': cw + 'px'
           });
       });
       ```
   
 *  Thread Starter [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992928)
 * Now I have a new problem. The jQuery is making the height 10400 px which is definitely
   not the width of block-1.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992929)
 * Can you link the webpage with the issue?
 *  Thread Starter [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992930)
 * [Website](http://caseyvassios.com/) caseyvassios(dot)com
 *  Thread Starter [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992932)
 * Does it have something to do with me using a % width value for block-1 and it
   not converting to px correctly for block-me height?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992933)
 * Try removing this jQuery:
 *     ```
       jQuery(document).ready(function ($) {
           var cw = jQuery('.block-1').width();
           $('#block-me').css({
               'height': cw + 'px'
           });
       });
       ```
   
 * and see if the issue persists.
 *  Thread Starter [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992934)
 * That’s the whole thing I was wanting to add to make it black block divs squares
   in the first place :/
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992935)
 * Would it be easier to instead deactivate all plugins?
 *  Thread Starter [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992936)
 * I’m not sure I understand what you’re saying.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992937)
 * Can you deactivate all plugins?
 *  Thread Starter [redf150flames](https://wordpress.org/support/users/redf150flames/)
 * (@redf150flames)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992938)
 * If I deactivate my Jetpack plugin it will remove all the CSS I have added for
   whats on my homepage. I can deactivate contact form 7 and my SEO plugin if you
   want.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992939)
 * In a normal situation your jQuery will work, as you’ve found on JSFiddle. There
   is something affecting that jQuery and if it’s not plugins then you need to explore
   whether there could be anything from your theme. So it would be best to contact
   [your theme’s vendors](http://wpbox.net) as we don’t support that theme.

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

The topic ‘JavaScript File Not Working’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 2 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-file-not-working/#post-3992939)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
