Title: Add javascript function to page
Last modified: August 30, 2016

---

# Add javascript function to page

 *  [h_assefi](https://wordpress.org/support/users/h_assefi/)
 * (@h_assefi)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/add-javascript-function-to-page/)
 * hello
 * One of my pages has a link that when it is pressed it should communicate with
   the DB. I have 2 files added to the root of my domain address – add.php, jquery.
   js.
    in the wordpress page I have added below code:
 *     ```
       <script src="jquery.js"></script>
       <a href="add(true);">Click Me</a>
       <script type="text/javascript">
       function add(b){
          function operation;
       }
       </script>
       ```
   
 * But, in the page when I click on the link-Click Me- nothing happens.
    please 
   tell me what should I do ?

The topic ‘Add javascript function to page’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [h_assefi](https://wordpress.org/support/users/h_assefi/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/add-javascript-function-to-page/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
