我正在处理一个.cfm文件,该文件在数据库中搜索人员。一旦我开始使用“ onKeyUp”输入内容,搜索表单应填充一串名称,但是这给我的变量“ stearchy”未定义。
我对ColdFusion操纵DOM Elements还是很陌生,但是我认为这是范围的问题,因为它只是不阅读它。我尝试过的以下内容是: 将onKeyUp放在函数下方。
任何在正确方向上的帮助都将非常有用。下面是var代码:
var stearchy = function(){
while(document.getElementById(“ daGuess”)。options.length)document.getElementById(“ daGuess”)。options [0] = null;
nam = [];
hs = [];
var boundLeft = document.getElementById(“ daSearch”)。value.indexOf(“”);
如果(boundLeft <= 0)var boundLeft = document.getElementById(“ daSearch”)。value.length;
var boundRight = document.getElementById(“ daSearch”)。value.indexOf(“”)+1;
<!---如果(boundRight == -1)var boundRight = 0; ->
var ges = [];
对于(i = 0; i 0){
如果(document.getElementById(“ daSearch”)。value.search(/ [A-Z] [a-z] /)!= -1){
var noo = removeDiacritics(alums [i] [“ NameNickname”])。indexOf(removeDiacritics(document.getElementById(“ daSearch”)。value.slice(0,boundLeft)));;
var moo = removeDiacritics(alums [i] [“ NameFirst”])。indexOf(removeDiacritics(document.getElementById(“ daSearch”)。value.slice(0,boundLeft))));;
var loo = removeDiacritics(alums [i] [“ NameLast”])。indexOf(removeDiacritics(document.getElementById(“ daSearch”)。value.slice(boundRight,document.getElementById(“ daSearch”)。value.length))) ;
/ *否则,请执行不区分大小写的搜索* /
}其他{
var noo = removeDiacritics(alums [i] [“ NameNickname”])。toLowerCase()。indexOf(removeDiacritics(document.getElementById(“ daSearch”)。value.toLowerCase()。slice(0,boundLeft))));;
var moo = removeDiacritics(alums [i] [“ NameFirst”])。toLowerCase()。indexOf(removeDiacritics(document.getElementById(“ daSearch”)。value.toLowerCase()。slice(0,boundLeft))));;
var loo = removeDiacritics(alums [i] [“ NameLast”])。toLowerCase()。indexOf(removeDiacritics(document.getElementById(“ daSearch”)。value.toLowerCase()。slice(boundRight,document.getElementById(“ daSearch” ).value.length)));
}
如果(document.getElementById(“ daSearch”)。value.indexOf(“”)> 0 && document.getElementById(“ daSearch”)。value.indexOf(“”)
这是搜索表单的onKeyUp函数:
搜索:
<脚本>
document.getElementById(“ daSearch”)。focus();
答案 0 :(得分:1)
可能是
import itertools
import networkx as nx
c4_leaves = [56,78,90,112]
G_ex = nx.Graph()
G_ex.add_nodes_from(c4_leaves)
G_ex.add_edges_from(itertools.combinations(c4_leaves, 2))
答案 1 :(得分:0)
我找到了答案:
我遇到了一个字符串文字问题,该问题导致实际变量无法正常工作。
以前是什么:
var alums = [<cfoutput query="Final">{NameNickname:"#Replace(Trim(NameNickname),"""","'","ALL")#",NameFirst:"#Replace(Trim(NameFirst),"""","'","ALL")#",NameMiddle:"#Replace(Trim(NameMiddle),"""","'","ALL")#",NameLast:"#Replace(Trim(NameLast),"""","'","ALL")#",Email:"#Trim(PhoneNumber)#",IDStudent:"#IDStudent#",HS:"#School_current#"}<cfif RecordCount NEQ CurrentRow>,</cfif></cfoutput>];
我必须更改电话号码中的电子邮件字符串,以便正确阅读。
var alums = [<cfoutput query="Final">{NameNickname:"#Replace(Trim(NameNickname),"""","'","ALL")#",NameFirst:"#Replace(Trim(NameFirst),"""","'","ALL")#",NameMiddle:"#Replace(Trim(NameMiddle),"""","'","ALL")#",NameLast:"#Replace(Trim(NameLast),"""","'","ALL")#",Email:"",IDStudent:"#IDStudent#",HS:"#School_current#"}<cfif RecordCount NEQ CurrentRow>,</cfif></cfoutput>];
但是,我确实更改了var函数并输入了text / javascript,所以效果也不错。
非常感谢大家的指导!