未捕获到的TypeError:未定义不是Joomla中的函数!模板 [英] Uncaught TypeError: undefined is not a function in Joomla! template

查看:90
本文介绍了未捕获到的TypeError:未定义不是Joomla中的函数!模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在自己的J模板中出现此错误,该模板中的jquery是通过 script 标记链接的.

I've this error in my own J template, where jquery is linked by script tag.

此脚本中发生错误:

$(document).ready(function(){
    $('.login-dropdown').click(function() { //this passes (tested with alert)
        $('.login-container').show(); // there is error
    });
});

记录- .login-container 具有 display:none ,可以通过 show()方法正确显示.

for record - .login-container has display:none which could by right for show() method.

我怀疑jquery和joomla之间存在冲突,但不知道最终如何处理.

I suspect the conflict between jquery and joomla, but do not know how to deal with it eventually.

感谢您的帮助.

推荐答案

Joomla使用mootools,因此它们之间可能存在冲突.

Joomla uses mootools, so there might be conflict between them.

使用 $ .noConflict():

jQuery.noConflict();
jQuery(document).ready(function($){
    $('.login-dropdown').click(function() { //this passes (tested with alert)
        $('.login-container').show(); // there is error
    });
});

这篇关于未捕获到的TypeError:未定义不是Joomla中的函数!模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆