This has got to be something simple. I searched the internet and only found syntax errors as the cause of this problem, but I can't find a syntax error.
Here's the javascript :
<script type="text/javascript" src="http://localhost/acrilart/javascript/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
function hi(){
alert('hi');
}
hi();
});
</script>
And the HTML :
<input type="text" name="cep" value="" id="cep" class="required cep field"
onChange="hi()" />
On pageload the function hi
is called as expected, but my onChange
event causes a Firebug error, saying the function is not defined. I'm really stumped. Did I mispell 'hi'?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…