douxian1895 2011-09-29 02:23
浏览 37
已采纳

php代码转入js [关闭]

the javascript code in php is

<script language="JavaScript" type="text/javascript">
xajax_getCountry('<?php echo $row['mradio_area']?$row['mradio_area']:0 ?>',
<?php echo $row['mradio_country']?$row['mradio_country']:0 ?>,
<?php echo ($row['mradio_rate']==1?1:0); ?>);
</script>

I want to put it into the .js file.

How do I change the <?php echo $row into js format?

Thanks a lot for any answer!

  • 写回答

1条回答 默认 最新

  • dpp42324 2011-09-29 03:11
    关注

    i just don't know what you are doing because there is no javascript at all but if you want to make this as javascript .js file set the headers of this php file using this code

    header("Content-type: text/javascript");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置