javascripts:Uncaught 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.