简体   繁体   English

jQuery无法在wordpress的footer.php文件中工作?

[英]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.

相关问题 jQuery未定义-WordPress footer.php - jQuery is not defined - WordPress footer.php wordpress 主题页脚.php 文件有一些恶意代码 - wordpress theme footer.php file have some malicious code footer.php wordpress中的一段javascript可以在PC上运行,但不能在移动设备上运行 - A piece of javascript in footer.php wordpress does work on PC but not on mobile 为什么在WP主题中,如果我从functions.php加载SlideShow(JQuery FlexSlider)不能工作,但是如果我从footer.php文件中加载它,则它可以工作吗? - Why in WP theme a SlideShow (JQuery FlexSlider) can't work if I load it form functions.php but work if I load it from my footer.php file? 我想在页脚中编辑页脚致谢。 我正在使用 Whitedot 主题。 这是我的 footer.php 文件的代码 - I want to edit footer credits in my footer. I am using the Whitedot theme. This is the code of my footer.php file 如何在WordPress站点上运行WordPress插件“数据表”并从footer.php启动脚本? - How can I run WordPress-plugin “Data Tables” on a WordPress-site and start the script from footer.php? 在PHP文件中添加了jquery jAlert代码,但无法正常工作 - Added jquery jAlert code inside php file but it's not working WordPress的+ jQuery的(在functions.php内部)不起作用 - Wordpress + jquery (inside functions.php) not working 在我的footer.php中找到带有html链接的未知javascript - Unknown javascript with html links found in my footer.php 应从footer.php调用时返回未定义的函数 - Function returning undefined when it should be called from footer.php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM