更新时间:2023-02-25 13:08:02
您可以在单独的php块中定义值:
You could define the value in a separate php block:
<script type="text/javascript">
var value = '<?=$your_permit_standard?>';
</script>
然后在您的JS中使用它:
And then use it in your JS:
if ( $('#postage6').val() == "Your Permit Standard" ) {
$('#postage6rate').val(value);
}
但是随后您将在PHP中引入JS依赖关系,我不建议这样做,但是由于您仍然将两者混合在一起...
But then you would be introducing JS dependency in PHP, which I wouldn't recommend, but since you're mixing both anyway...