简体   繁体   English

从给出错误的函数中调用greybox弹出窗口

[英]Calling greybox popup from a function giving error

As per the example given in stackoverflow I tried greybox popup, calling from a function based on a if condition in my php program. 按照在stackoverflow中给出的示例,我尝试了greybox popup,从基于php程序中if条件的函数调用。

It gives an error like: Parse error: syntax error, unexpected '=' in /home/public_html/atst/dc-detail-qty.php on line 456 它给出如下错误:解析错误:语法错误,第456行在/home/public_html/atst/dc-detail-qty.php中出现意外的'='

The php partial code with if condition true, the greybox popup should work: 如果条件为true,则php部分代码将显示灰框弹出窗口:

if($dcecrbal < 0)
{
$pop=100;
echo "<span class='sty1'>Negative Bal: ".$dcecrbal." (Total ECR: ".$ecrdtl." - Total DCs: ".$dcdtl.") </span>";
//echo "<script>child_open();</script>";

echo "<script>";
pathArr = window.location.pathname.split('/');
    path = window.location.protocol + "//" + window.location.host+"/";
    for (i=1;i<pathArr.length-1;i++) path += pathArr[i]+"/";

    GB_showCenter('ECR', path+'ecrframe-qty.php' , 800, 600);
echo "</script>";
}

That should be like this 那应该是这样的

echo "<script>
      pathArr = window.location.pathname.split('/');
    path = window.location.protocol + '//' + window.location.host+'/';
    for (i=1;i<pathArr.length-1;i++) path += pathArr[i]+'/';

    GB_showCenter('ECR', path+'ecrframe-qty.php' , 800, 600)";
echo "</script>";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM