0

**getting this error "Uncaught TypeError: Object # has no method 'tree' " at this "$('#tree1').tree" code line Refer this eg http://mbraak.github.com/jqTree/ the same code works on other page but it contains only 1.jqtree.css 2.div id=tree1 div 3. and three jquery file jquery-1.8.0.js, tree.jquery.js and prism.js 4. contains the fumction code written in script tag below


<head>
    <title>Ksa Maps</title>
    <link href="../Css/Site.css" rel="stylesheet" type="text/css" />   
    <link href="../Css/advancedtable.css" rel="stylesheet" type="text/css" />
    <link href="../Css/AdvTblStyle.css" rel="stylesheet" type="text/css" />
    <link href="../Css/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" /> 
    <link href="../Css/CityFilter.css" rel="stylesheet" type="text/css" />
    <link href="../Css/ddsmoothmenu.css" rel="stylesheet" type="text/css" />
    <link href="../Css/dcmegamenu.css" rel="stylesheet" type="text/css" />
    <link href="../Js/autoCombo/tryy.css" rel="stylesheet" type="text/css" />
    <link href="../Js/autoCombo/demos.css" rel="stylesheet" type="text/css" />
    <link href="menu.css" rel="stylesheet" type="text/css" />
    <link href="../jquery.confirm/jquery.confirm.css" rel="stylesheet" type="text/css" />
       <!--  Tree-->
      <link href="../Css/jqtree.css" rel="stylesheet" type="text/css" />   
     <!--<link href='http://fonts.googleapis.com/css?family=Corben:bold&amp;v1' rel='stylesheet' type='text/css'>-->
     <!--  Tree-->

</head>
<body>
 <div id="tree1"></div>  
    <script src="../Js/autoCombo/jquery-1.8.0.js" type="text/javascript"></script>
    <!-- tree  --> 
    <script src="../Js/prism.js" type="text/javascript"></script>
    <script src="../Js/tree.jquery.js" type="text/javascript"></script>
   <!-- tree  --> 
    <script src="../Js/autoCombo/jquery.ui.core.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.autocomplete.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.button.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.position.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.widget.js" type="text/javascript"></script>  
    <script src="../Js/JQuery.js" type="text/javascript"></script>
    <script src="../Js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="../Js/picnet.table.filter.min.js" type="text/javascript"></script>     
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3.9&sensor=true"></script>
    <script src="../Js/jquery-ui-1.8.22.custom.min.js" type="text/javascript"></script>
    <script src="../Js/advancedtable.js" type="text/javascript"></script>  
    <script src="../Js/ddsmoothmenu.js" type="text/javascript"></script>
    <script src="../Js/poiScript.js" type="text/javascript"></script>
    <script src="../Js/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.dcmegamenu.1.3.3.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.hoverIntent.minified.js" type="text/javascript"></script>
    <script src="../Js/jquery.dcmegamenu.1.3.3.js" type="text/javascript"></script>
    <script src="../Js/menu.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/TRYY.js" type="text/javascript"></script>
    <script src="../jquery.confirm/jquery.confirm.js" type="text/javascript"></script> 
    <script>
       $(function() {
           var data = [
            {
                label: 'node1',
                children: [
                    { label: 'child1' },
                    { label: 'child2' }
                ]
            },
            {
                label: 'node2',
                children: [
                    { label: 'child3' }
                ]
            }
        ];
           $('#tree1').tree({
               data: data,
               autoOpen: true,
               dragAndDrop: true
           });
       });
</script>
</body>
</html>

Change code of onTouchEvent to

int color = button1.getCurrentTextColor();
int r = (color) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = (color >> 16) & 0xFF;
int a = (color >> 24) & 0xFF;
button1.setTextColor(Color.argb(DOWN_Alpha, r, g, b));
4

1 回答 1

2

移动你的实际tree.jquery.js <script> jquery.js <script>

 <div id="tree1"></div>  
    <script src="../Js/autoCombo/jquery-1.8.0.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.core.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.autocomplete.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.button.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.position.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/jquery.ui.widget.js" type="text/javascript"></script>  
    <script src="../Js/JQuery.js" type="text/javascript"></script>
    <script src="../Js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="../Js/picnet.table.filter.min.js" type="text/javascript"></script>     
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3.9&sensor=true"></script>
    <script src="../Js/jquery-ui-1.8.22.custom.min.js" type="text/javascript"></script>
    <script src="../Js/advancedtable.js" type="text/javascript"></script>  
    <script src="../Js/ddsmoothmenu.js" type="text/javascript"></script>
    <script src="../Js/poiScript.js" type="text/javascript"></script>
    <script src="../Js/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.dcmegamenu.1.3.3.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.hoverIntent.minified.js" type="text/javascript"></script>
    <script src="../Js/jquery.dcmegamenu.1.3.3.js" type="text/javascript"></script>
    <script src="../Js/menu.js" type="text/javascript"></script>
    <script src="../Js/autoCombo/TRYY.js" type="text/javascript"></script>
    <script src="../jquery.confirm/jquery.confirm.js" type="text/javascript"></script>
    <!-- tree  --> 
    <script src="../Js/prism.js" type="text/javascript"></script>
    <script src="../Js/tree.jquery.js" type="text/javascript"></script>
   <!-- tree  --> 

实际上,看起来您包含了很多jQuery。你需要删除很多。

于 2012-11-22T07:41:40.357 回答