Title: &quot;Add Media&quot; Button not working – Javascript error
Last modified: August 21, 2016

---

# "Add Media" Button not working – Javascript error

 *  [Noinda](https://wordpress.org/support/users/noinda/)
 * (@noinda)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/add-media-button-not-working-javascript-error/)
 * Hi guys,
 * for days now I haven’t been able to use the “add media” button in my wordpress
   installation’s editor (3.9.1). When I press it, nothing happens. I read in the
   forums that quite a few people came across this error and tried the suggestions
   given there.
 * **What I did:**
 * > – deactivated all plug-ins
   >  – activated the wordpress default theme – deleted
   > my browser’s cache – tried to use the button with three different browsers:
   > Chrome, Firefox and Opera (newest versions) – double-checked that javascript
   > is activated in all the browsers
 * **The console reads:**
 * > Uncaught EvalError: Refused to evaluate a string as JavaScript because ‘unsafe-
   > eval’ is not an allowed source of script in the following Content Security 
   > Policy directive: “script-src ‘unsafe-inline’ ‘self'”.
 * and:
 * > Uncaught TypeError: Cannot read property ‘hasClass’ of undefined
 * Any suggestions what could be the problem? Help? 🙁 Thanks in advance!

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/add-media-button-not-working-javascript-error/#post-5094879)
 * Have you tried:
 * – [resetting the plugins folder](http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F)
   by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause
   problems.
 * – re-uploading all files & folders – **except** the wp-content folder and wp-
   config.php & root .htaccess files – from a **fresh** download of WordPress. Make
   sure that you delete the old copies of files & folder before uploading the new
   ones.
 *  Thread Starter [Noinda](https://wordpress.org/support/users/noinda/)
 * (@noinda)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/add-media-button-not-working-javascript-error/#post-5094905)
 * I am quite sure that the error is caused by WordPress’ usage of JavaScript function“
   eval()” — which I am told is completely unneccessary.
 * Any chance “eval()” gets removed from uploading in the next version?

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

The topic ‘"Add Media" Button not working – Javascript error’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Noinda](https://wordpress.org/support/users/noinda/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/add-media-button-not-working-javascript-error/#post-5094905)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
