Javascript 未捕获范围错误:超过最大调用堆栈大小
所以我有一个问题,它说:“jquery.min.js:4 Uncaught RangeError:超过了最大调用堆栈大小”,我不知道如何修复它,我正在修复别人的代码,这是我的php代码 我的jsJavascript 未捕获范围错误:超过最大调用堆栈大小,javascript,php,jquery,Javascript,Php,Jquery,所以我有一个问题,它说:“jquery.min.js:4 Uncaught RangeError:超过了最大调用堆栈大小”,我不知道如何修复它,我正在修复别人的代码,这是我的php代码 我的js 函数displayCom() { var com=document.getElementById(“sel_cloud”).value; if(com
函数displayCom()
{
var com=document.getElementById(“sel_cloud”).value;
if(com<0){
//抛出异常(“请选择一个接口”)
}
否则{
$.ajax({
类型:“POST”,
url:“../administration/func\u manager/ajax\u subscribers.php”,
数据:{selfinterface:com},
成功:功能(数据){
警报(数据);
$(“#sel_communicator”).html(数据);
}
});
}
}
下面是我的ajax和我的select,其中使用了dislayCom()函数:
<?php
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
$current_interface = 'CPANEL';
require_once '../../cao/sys/config.class.php';
if(isset($_POST['selInterface'])){
$interfaceID = pg_escape_string($_POST['selInterface']) ;
if($_POST['selInterface'] =='120'){
$curr_cao = new CGenDb("reddi", '12.121.21.21', 2);
$curr_cao_tac = new CGenDb("reddi_tac", "12.121.21.21", 2);
}elseif($_POST['selInterface'] =='121'){
$curr_cao = new CGenDb("reddi", '212.121.21.21', 12);
$curr_cao_tac = new CGenDb("database", "212.121.21.21", 12);
}else{
echo "no Interface found";
}
$query = new CGenRs("SELECT * FROM tac_account ",$curr_cao_tac);
$query->first();
?>
<div class="row well well-lg">
<div class="-md-2" >
<span> communicator </span>
</div>
<div class="col-md-4">
<select>
<?php
if($query->rowcount()){
while (!$query->eof() ){
?>
<option value="<?php echo $query->valueof('acc_id'); ?>"><?php echo $query->valueof('acc_name') ?> </option>
<?php
$query->next();
}
}
?>
</select>
</div>
</div>
<?php
}
<span>Select Interface (required)</span>
</div>
<div class="col-md-4" >
<select name="sel_cloud" id="sel_cloud" onchange="displayCom()" class="form-control">
<option value="-1">Select Interface</option>
<?php
$sel_interface_options = new CGenRS("select type_desc, type_id from lu_type where type_status = 't' and type_group = 'cloud' and type_sub_group = 'db'", $cao);
$sel_interface_options->first();
if ($sel_interface_options->rowcount()) {
while (!$sel_interface_options->eof()) {
?>
<option value="<?php echo $sel_interface_options->valueof('type_id'); ?>" ><?php echo $sel_interface_options->valueof('type_desc'); ?></option>
<?php
$sel_interface_options->next();
}
}
?>
</select>
</div>
<br/>
通信器
您在哪里调用displayCom()
?也许你有一个无限循环。对不起,我怎么会忘记这里我怎么添加它编辑你的帖子。链接位于标签后面的底部。我按照您说的那样添加了它。您在哪里调用displayCom()
?也许你有一个无限循环。对不起,我怎么会忘记这里我怎么添加它编辑你的帖子。链接位于标签后面的底部。我按照你说的添加了它
<?php
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
$current_interface = 'CPANEL';
require_once '../../cao/sys/config.class.php';
if(isset($_POST['selInterface'])){
$interfaceID = pg_escape_string($_POST['selInterface']) ;
if($_POST['selInterface'] =='120'){
$curr_cao = new CGenDb("reddi", '12.121.21.21', 2);
$curr_cao_tac = new CGenDb("reddi_tac", "12.121.21.21", 2);
}elseif($_POST['selInterface'] =='121'){
$curr_cao = new CGenDb("reddi", '212.121.21.21', 12);
$curr_cao_tac = new CGenDb("database", "212.121.21.21", 12);
}else{
echo "no Interface found";
}
$query = new CGenRs("SELECT * FROM tac_account ",$curr_cao_tac);
$query->first();
?>
<div class="row well well-lg">
<div class="-md-2" >
<span> communicator </span>
</div>
<div class="col-md-4">
<select>
<?php
if($query->rowcount()){
while (!$query->eof() ){
?>
<option value="<?php echo $query->valueof('acc_id'); ?>"><?php echo $query->valueof('acc_name') ?> </option>
<?php
$query->next();
}
}
?>
</select>
</div>
</div>
<?php
}
<span>Select Interface (required)</span>
</div>
<div class="col-md-4" >
<select name="sel_cloud" id="sel_cloud" onchange="displayCom()" class="form-control">
<option value="-1">Select Interface</option>
<?php
$sel_interface_options = new CGenRS("select type_desc, type_id from lu_type where type_status = 't' and type_group = 'cloud' and type_sub_group = 'db'", $cao);
$sel_interface_options->first();
if ($sel_interface_options->rowcount()) {
while (!$sel_interface_options->eof()) {
?>
<option value="<?php echo $sel_interface_options->valueof('type_id'); ?>" ><?php echo $sel_interface_options->valueof('type_desc'); ?></option>
<?php
$sel_interface_options->next();
}
}
?>
</select>
</div>
<br/>