【发布时间】:2011-06-18 05:52:51
【问题描述】:
我正在为一个客户建立一个 Wordpress 网站,它将有一个电子商店。我正在使用 wp 电子商务。所有商店页面都在加载一个 javascript 错误:
http://www.thecollectiveclothingco.com/products-page/t-shirts/
jQuery("form.product_form").livequery is not a function
[Break On This Error] jQuery("form.product_form").livequery(function(){
经过一段广泛的谷歌时代之后,我相信我已经将问题诊断为脚本冲突。换句话说,WP 或插件本身都在为 jquery 提供服务,我还将它包括在网站上的其他一些东西上。当我删除我的 jquery 脚本调用时,问题就消失了,商店工作正常。但我需要那个 jquery...
我已阅读有关使用 WP enqeue 解决问题的信息:
function my_init_method() {
if (!is_admin()) {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
}
add_action('init', 'my_init_method');php wp_head();
我相信我做对了,但似乎没有解决任何问题。
有什么想法吗?再次感谢。
【问题讨论】: