参考错误:函数未定义

时间:2012-05-19 10:02:25

标签: javascript jquery html ajax json

错误:

  

ReferenceError:未定义setDynaTreeCustom

add.js 代码:

 ......
success: function(treeData){                  
                        try{
                            showPopup("Add Fields|",'multi_list','event',0,0,1);  
                            alert("Here00!!")
                            setDynaTreeCustom(treeData);
                            alert("Here!!!");
                        }
                        catch(e)
                        {
                            alert(e);
                            alert(e.lineNumber);
                            errorExceptionLog(e,"js/request_custom_fields.js","populateTree","Custom Report","Creating Tree");
                        }
                    }

Diff.js

 function setDynaTreeCustom(treeData) {

        try{
            alert(" 000")
     ........// rest of the code
 .....
}

alert("Here00!!")之后它说函数setDynaTreeCustom是未定义的,即使我在相同文件夹中的CustomReport.js中定义了不同的js。

1 个答案:

答案 0 :(得分:0)

确保在add.js

之前在你的标记中声明diff.js