我正在使用以下插件在IE8和IE9中显示占位符。我认为它在去年有效,但现在还不是:
https://github.com/mathiasbynens/jquery-placeholder
实际上,此插件可以在演示页面上完美运行:http : //mathiasbynens.be/demo/placeholder
我真的不知道该如何解决。我在WordPress中使用了它,我在其中加载了本地jQuery,如果我记得很好的话,这通常是最新版本。我将脚本放入functions.php中:
function szt_load_scripts() {
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_style( 'shortcodes', get_stylesheet_directory_uri() . '/shortcodes.css' );
wp_enqueue_script('jquery');
if ( is_singular() ) {
wp_enqueue_script( 'comment-reply' );
}
if (ot_get_option('szt_enable_linkbuilding') === "on") {
wp_deregister_script( 'link-building-pro-min' );
wp_register_script( 'link-building-pro-min', get_template_directory_uri().'/jquery/link-building-pro/link-building-pro-min.js', array(), true, true);
wp_enqueue_script( 'link-building-pro-min' );
}
wp_enqueue_script('scripts', get_stylesheet_directory_uri() . '/jquery/scripts.js');
wp_localize_script('scripts', 'contactForm', array(
'youForgot' => __('<span class="errormsg">You forgot to enter your ', 'wptheme'),
'invalidEmail' => __('<span class="errormsg">You entered an invalid email.</span>', 'wptheme'),
'messageSent' => __('<p class="thanks"><strong>Thanks!</strong> Your message was successfully sent.</p>', 'wptheme')
));
}
add_action('wp_enqueue_scripts', 'szt_load_scripts');
我是否以错误的方式加载了插件?我需要使用旧版本的jQuery吗?我是否需要为此添加其他修复程序?
您必须在(document).ready()中初始化插件。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句