Search code examples
javascriptjqueryjquery-pluginsliferay-themeliferay-velocity

how to resolve Uncaught TypeError: Object #<Object> has no method 'corner' in jquery?


I am using jquery round corner plugin in lifray theme in order to add round corner functionality in all kind of browsers, including IE6 to IE8. i have included the jquery round corner plugin in portla_normal.vm like this :-

<head>
    <title>$the_title - $company_name</title>

    <script type="text/javascript" src="/html/js/jquery/jquery.js"></script>                    
    <script type="text/javascript" src="$javascript_folder/jquery_roundcorner.js"></script>
    <script type="text/javascript" src="$javascript_folder/jquery.corner.js"></script>

        $theme.include($top_head_include)

 </head>

This is my jquery_roundcorner.js file, when i see on console of the browser getting the error in this file like below.

$(document).ready(function()    {
    $('#navigation li').corner("round 6px");
    $('#navigation a').corner("round 6px");
});

I am geting following error on browser console:

Uncaught TypeError: Object #<Object> has no method 'corner'.

Can any one help me how to resolve this?


Solution

  • in my jquery_roundcorner.js i have replaced the above code with the following code. Actually in velocity file also $ is used, there may be conflicts. so lastly i tried this, its working now.

    var jq=$.noConflict();
    jq(document).ready(function(){
        alert('hello alert1 ');
        jq('#navigation li').corner("round 6px");
        jq('#navigation a').corner("round 6px");
        alert('hello alert3 ');
    });