[英]jQuery not working inside the wordpress's footer.php file?
I have to include these code inside the footer.php file of wordpress but it is not working , 我必须将这些代码包含在wordpress的footer.php文件中,但无法正常工作,
<script type="text/javascript">
jQuery('#vpb_captcha_code_102').blur(function(){
var value= jQuery('#vpb_captcha_code_102').val();
alert(value);
});
</script>
Whereas if i try to run this same code from console it works, please let me know what should i do. 而如果我尝试从控制台运行相同的代码,那么它可以工作,请告诉我该怎么办。
A page can't be manipulated safely until the document is "ready."
在文档
"ready."
之前,无法安全地操纵页面"ready."
jQuery detects this state of readiness for you. jQuery为您检测到这种就绪状态。
Please make changes in code as: 请按以下方式更改代码:
<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery('#vpb_captcha_code_102').blur(function(){
var value= jQuery('#vpb_captcha_code_102').val();
alert(value);
});
});
</script>
https://www.w3schools.com/jquery/ https://www.w3schools.com/jquery/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.