gpt4 book ai didi

netbeans - Netbeans-使用javascript内的php进行语法检查错误

转载 作者:行者123 更新时间:2023-12-03 08:16:30 28 4
gpt4 key购买 nike

当我在JavaScript中使用PHP时,Netbeans 7.0将行突出显示为语法错误

就我而言

<script type="text/javascript">
$(document).ready(function(){
$("#rating_<?=$coObj->company_id?>").jRating({
step: true,
longStarsPath:"include/jrating/jquery/icons/btn_black_trans2.png",
rateMax:1,
phpPath:"include/jrating/php/jRating.php",
<?php
if($_SESSION["rate_of_".$coObj->company_id] == 1)
echo 'isDisabled: true,';
else
echo 'isDisabled: false,';
?>
type:'long',
length : 1,
decimalLength : 0,
rateMax: 1,

onSuccess : function(){
alert('Success : your rating has been saved');
location.reload(true);
},
onError : function(){
alert('Error : please retry');
}
});
});
</script>

PHP代码下面的所有行都突出显示,第一行说 missing:在属性id 之后

最佳答案

编辑语法为:

isDisabled:<?php
if($_SESSION["rate_of_".$coObj->company_id] == 1)
echo 'true';
else
echo 'false';
?>,

关于netbeans - Netbeans-使用javascript内的php进行语法检查错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5897123/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com