到目前为止,我一直在使用 knockoutJS 和 jQuery,没有任何问题,但是仅在我的 html 中包含prototype.js 文件,在启动应用程序时会导致几个错误。我在开始时运行 jQuery.noConflict() 以避免 jQuery 和prototypejs 之间的冲突,但显然它并没有解决问题。代码和错误如下:
<script type="text/javascript" src="js/jquery/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery-contextmenu.js"></script>
<script type="text/javascript" src="js/jquery/jquery.tmpl.js"></script>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>
<!-- knockout library -->
<script type="text/javascript" src="js/knockout-1.2.1.js"></script>
<script type="text/javascript" src="js/knockout.mapping-latest.js"></script>
//////////////
currentServerTree[key].serverName 不是函数 anonymous()knockout-1.2.1.js(第 11 行)
Za(a=" { text: scoringFunctio...n = __ko_value; } } } ", b=Object { preferenceName=d(), selectedServer=d(), selectedDatabase=d(), more...})knockout-1.2.1.js (line 11)
J()knockout-1.2.1.js (line 44)
j()knockout-1.2.1.js (line 34)
j(e=function(), d=null, b=Object { disposeWhenNodeIsRemoved=textarea#inScoreFunction.inputField, read=function(), disposeWhen=function()})knockout-1.2.1.js (line 36)
J(e=textarea#inScoreFunction.inputField, d=null, b=Object { preferenceName=d(), selectedServer=d(), selectedDatabase=d(), more...}, a="data-bind")knockout-1.2.1.js (line 45)
ua(a=textarea#inScoreFunction.inputField)knockout-1.2.1.js (line 45)
g(a=[input#singleTable.inputField Constant, input#joinTable.inputField Variable, th, 16 more...], b=function())knockout-1.2.1.js (line 8)
ua(e=Object { preferenceName=d(), selectedServer=d(), selectedDatabase=d(), more...}, d=table#attributesTable4)knockout-1.2.1.js (line 45)
()index.jsp (line 1052)
[Break On This Error]
...rn "+a))();return(new Function("sc","with(sc) { return ("+a+") }"))(b)},Fa:funct...
如果我删除prototype.js 行,一切都运行得很好。知道可能导致问题的原因吗?谢谢!