Title: javascripts:Uncaught ReferenceError: function is not defined
Last modified: August 20, 2016

---

# javascripts:Uncaught ReferenceError: function is not defined

 *  [wdisk](https://wordpress.org/support/users/wdisk/)
 * (@wdisk)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/javascriptsuncaught-referenceerror-function-is-not-defined/)
 * b.js call function defined in a.js, but get “Uncaught ReferenceError: function**
   a** is not defined”
    Thanks in advance!
 * index.htm
 *     ```
       <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
       <script type='text/javascript' src='jquery.js'></script>
       <script type='text/javascript' src='a.js'></script>
       <script type='text/javascript' src='b.js'></script>
       </head>
       <body>
       <a href="#" class="text">1234</a>
       </body>
       </html>
       ```
   
 * a.js
 *     ```
       jQuery(document).ready(function($) {
       	function a()
       	{
       		alert(123);
       	}
       })
       ```
   
 * b.js
 *     ```
       jQuery(document).ready(function($) {
       	$('.text').click(function(e){
       		a();
       		e.preventDefault();
       	})
       })
       ```
   

The topic ‘javascripts:Uncaught ReferenceError: function is not defined’ is closed
to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [wdisk](https://wordpress.org/support/users/wdisk/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/javascriptsuncaught-referenceerror-function-is-not-defined/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
