Title: Custom Javascript error only when non-admin
Last modified: March 2, 2021

---

# Custom Javascript error only when non-admin

 *  [adamlaird](https://wordpress.org/support/users/adamlaird/)
 * (@adamlaird)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-javascript-error-only-when-non-admin/)
 * Hi,
 * I have a custom code block that was working well for the past year or so. A couple
   of months ago (I have not been checking the site very often – but was told by
   others) that it had stopped working. It is having an error with the custom javascript
   in a code block. However, it works as expected when I am logged in as an admin
   and view the page, so it is only a problem for users. (So its clear if you go
   to the site. the custom block is the “apr calculator form, and it should have
   default numbers already in.”)
 * I am also noticing this error at the top of my wordpress dashboard, could this
   have anything to do with it?
    `Warning: fopen(/home/hp3-linc2-nfs1-w/229/2190229/
   user/htdocs/wp-content/uploads/wpcf7_uploads/.htaccess): failed to open stream:
   No such file or directory in /home/customer/www/myapr.info/public_html/wp-content/
   plugins/contact-form-7/includes/file.php on line 247`
 * Has anyone seen a similar thing or have any ideas?
    -  This topic was modified 5 years, 2 months ago by [adamlaird](https://wordpress.org/support/users/adamlaird/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-javascript-error-only-when-non-admin%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Ian Sackofwits](https://wordpress.org/support/users/plantprogrammer/)
 * (@plantprogrammer)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-javascript-error-only-when-non-admin/#post-14127541)
 * Hi, adamlaird, I believe that the issue is because you have a syntax error in
   your JavaScript code in the same script that you use to pre-fill in the values
   for the calculator form so because of that error, that particular script is not
   loaded properly.
 * Here is an example line of code that needs to be fixed and there are some functions
   in your code like this:
 * `} // calculateApr area function myConcat(){`
 * You need to fully comment out the function definitions meaning from the first
   curly brace of the function to the closing brace of the function definition.

Viewing 1 replies (of 1 total)

The topic ‘Custom Javascript error only when non-admin’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Ian Sackofwits](https://wordpress.org/support/users/plantprogrammer/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/custom-javascript-error-only-when-non-admin/#post-14127541)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
