我從網上這段代碼,它工作正常解釋JavaScript和PHP代碼
<script type="text/javascript">
var jvalue = 'this is javascript value';
<?php $abc = "<script>document.write(jvalue)</script>"?>
</script>
<?php echo $abc;?>
但是當我把</script>
它停止工作結束,請解釋爲什麼它停止工作?
<script type="text/javascript">
var jvalue = 'this is javascript value';
<?php $abc = "<script>document.write(jvalue)</script>"?>
<?php echo $abc;?>
</script>
你不能把一個'script'標籤中'script'標籤 –
這個'$ ABC = 「」'更改爲'ABC $ = 「文件撰寫(jvalue)」'它應該工作 –
使用「... <\/script>」來防止th e在JS – dandavis