[英]"Uncaught TypeError: $(...).autocomplete is not a function" and Oracle Apex
So I am tearing my hair out trying to figure out why this isn't working.所以我正在努力弄清楚为什么这不起作用。 I keep getting an Uncaught TypeError: $(...).autocomplete is not a function
error.我不断收到Uncaught TypeError: $(...).autocomplete is not a function
错误。 I've searched stack overflow and tried everything I can find but it simply refuses to work.我已经搜索了堆栈溢出并尝试了所有我能找到的东西,但它只是拒绝工作。 I am trying to use this on an Oracle Apex application if that matters.如果这很重要,我正在尝试在 Oracle Apex 应用程序上使用它。
Does anyone have any suggestions as what to do?有没有人有什么建议?
<head>
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>
<table id="mytable" class="tg">
<colgroup>
<col>
<col>
<col>
<col>
</colgroup>
<tr>
<th class="tg-baqh"></th>
<th id="A1" class="tg-baqh">Table Name ==></th>
<th class="columnTypeCss"><div id = "TT00" contenteditable></div></th>
</td>
</tr>
<tr>
<th id="A1" class="tg-baqh">Column Name</th>
<th class="tg-baqh">Column Type</th>
<th class="tg-baqh">Other Arguments</th>
</tr>
<tr>
<td class="columnNameCss">
<div class="ui-widget">
<input id='AA00'>
</div>
</td>
<td class="columnTypeCss">
<div class="ui-widget">
<input id='BB00' >
</div>
</td>
<td class="otherArgumentsCss">
<div class="ui-widget">
<input id='CC00' >
</div>
</td>
</tr>
</table>
<div style="text-align: center;">
<button id="myButten2" class="butten" type="button" value="button">Add Column</button>
</div>
<div><br><br><br><br><br><br><br><br><br><br></div>
</body>
<script>
function createCell(cell, text) {
var div = document.createElement('div'), // create DIV element
txt = document.createTextNode(text); // create text node
//div.appendChild(txt); // append text node to the DIV
//div.setAttribute('class', style); // set DIV class attribute
cell.appendChild(div); // append DIV to the table cell
cell.innerHTML = "<div contenteditable>" + text + "</div>";
}
var addRow = function (event) {
var table = document.getElementById("mytable");
var numcols = document.getElementById('mytable').rows[0].cells.length;
var row = table.insertRow(-1);
var counter = document.getElementById("mytable").rows.length - 1;
if(counter<10){
var padded_counter = '0'+counter}
else{
var padded_counter = counter}
for (i = 0; i < numcols; i++) {
var cell1 = row.insertCell(-1);
if (i == 0) {
cell1.setAttribute('class', 'columnNameCss')
cell1.setAttribute('id', 'AA'+padded_counter)
cell1.innerHTML = "<div contenteditable></div>"
} else if (i == 1) {
cell1.setAttribute('class', 'columnTypeCss')
cell1.setAttribute('id', 'BB'+padded_counter)
cell1.innerHTML = "<div contenteditable></div>";
} else {
cell1.setAttribute('class', 'otherArgumentsCss')
cell1.setAttribute('id', 'CC'+padded_counter)
cell1.innerHTML = "<div contenteditable></div>"
}
//if(i=0){cell1.className = "columnNameCss";}
//if(i=3){cell1.className="columnNameCss"}
//else if (i=1){cell1.className="columnTypeCss"}else{
// cell1.className="otherArgumentsCss"
//}
}
}
document.getElementById("myButten2").addEventListener("click", addRow, false);
</script> <script>
$( function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags
});
} );
</script>
It can be related to the different versions of JQuery conflict.它可能与不同版本的 JQuery 冲突有关。 You can try to remove link to the jquery CDN or use apex.jQuery
instead of $
.您可以尝试删除指向 jquery CDN 的链接或使用apex.jQuery
而不是$
。
More: https://docs.oracle.com/database/121/HTMDB/app_comp001.htm#HTMDB29028更多: https : //docs.oracle.com/database/121/HTMDB/app_comp001.htm#HTMDB29028
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.