Title: javascript faults
Last modified: August 22, 2016

---

# javascript faults

 *  Resolved [micksp](https://wordpress.org/support/users/micksp/)
 * (@micksp)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/javascript-faults/)
 * I use a childtheme based on twentyfourteen.
    I got two javascript errors: ===
   == in file preveter-index.php, line 177
 *     ```
       var e = document.getElementsByTagName('body')[0];
       e.setAttribute('unselectable','on');
       ```
   
 * This yields error: e is undefined.
    I replaced it with:
 *     ```
       (function($) {
         $("body").prop("unselectable", "on");
       })(jQuery);
       ```
   
 * ======
    in preventer-index.php, line 128: `$(document).keydown(function(event){`
   yield error: $ is not a function. I replaced it with: `jQuery(document).keydown(
   function(event) {` ======== Now it’s fault free
 * [https://wordpress.org/plugins/wp-content-copy-protector/](https://wordpress.org/plugins/wp-content-copy-protector/)

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

 *  Plugin Author [wp-buy](https://wordpress.org/support/users/wp-buy/)
 * (@wp-buy)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/javascript-faults/#post-5702261)
 * you mean that these errors are fixed now using your new js codes?
 *  Thread Starter [micksp](https://wordpress.org/support/users/micksp/)
 * (@micksp)
 * [11 years ago](https://wordpress.org/support/topic/javascript-faults/#post-5702437)
 * Sorry, i didn’t see you responded to this post.
    Yes, adding my code resolves
   the errors. After the last update, the JS errors are back, see [this post](https://wordpress.org/support/topic/javascript-error-80)
   line 177 is now line 275. The second error (the keydown) is no longer present.
   Re-applying my fix resolves the error.

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

The topic ‘javascript faults’ is closed to new replies.

 * ![](https://ps.w.org/wp-content-copy-protector/assets/icon-256x256.png?rev=976781)
 * [WP Content Copy Protection & No Right Click](https://wordpress.org/plugins/wp-content-copy-protector/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-content-copy-protector/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-content-copy-protector/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-content-copy-protector/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-content-copy-protector/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [micksp](https://wordpress.org/support/users/micksp/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/javascript-faults/#post-5702437)
 * Status: resolved