javascript 里面放PHP 代码
<?php
if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE")){
?>
<script type="text/javascript">
$(document).ready(function() {
$('.speakkerSmall').speakker({
file: '<?php echo base_url('list/file/'. $recInfo['file'] . '/' . $recInfo['licno'] . '/' . session_id()); ?>',
title: 'one single MP3',
theme: 'light',
poster: 'cover.jpg'
});
</script>
<?php } ?>
-----------------------------------
上面这一段:
file: '<?php echo base_url('list/file/'. $recInfo['file'] . '/' . $recInfo['licno'] . '/' . session_id()); ?>',
怎么改?
------解决方案--------------------base_url
是怎么定义?
------解决方案--------------------file: '<?php echo base_url('list/file/'. $recInfo['file'] . '/' . $recInfo['licno'] . '/' . session_id()); ?>',
把引号换下...你外层用了单引号,php里层也用了单引号
file: "<?php echo base_url('list/file/'. $recInfo['file'] . '/' . $recInfo['licno'] . '/' . session_id()); ?>",