我有这样的代码编写PHP到JavaScript或JavaScript到PHP
var myChart = new FusionCharts("../themes/clean/charts/hbullet.swf", "myChartId", "400", "75", "0", "0");
myChart.setDataXML("<chart lowerLimit='0' upperLimit='100' caption='Revenue' subcaption='US $ (1,000s)' numberPrefix='$' numberSuffix='K' showValue='1'><colorRange><color minValue='0' maxValue='50' color='A6A6A6'/><color minValue='50' maxValue='75' color='CCCCCC'/><color minValue='75' maxValue='100' color='E1E1E1'/></colorRange><value>78.9</value><target>80</target></chart>");
myChart.render("chartdiv");
现在我想这个代码中编辑一些值。
但是,使用php函数编写“chartdiv”div,使事情更复杂,我需要将数据库值放入此代码中。是否有可能将我的PHP函数中的PHP变量放到这个.js文件中?或者更好甚至可以用PHP编写JavaScript?