关于open-flash-chart-2刷新问题

[复制链接]
查看11 | 回复1 | 2011-3-7 07:47:58 | 显示全部楼层 |阅读模式
我用的是open-flash-chart-2图形统计插件

原理是这样的,用AJAX请求PHP端生成数据写入txt文件中,flash从txt文件中读取数据 呈现成图表形式。

我现在遇到的问题是:每次请求PHP已经将新数据写入了txt文件了,但flash读取的时候每次都是读取第一次的请求数据。无法实现实时刷新。但txt中的数据内容已经改变了。现在不知道该怎么做啊。请老师帮助啊。

function chk(){
var month = $(\"#month\").val();
var day = $(\"#day\").val();
var fid = $(\"#fid\").val();

if(month == \"\" || day == \"\" || fid == \"\"){
alert(\"请将查询信息选择完整\");
return false;
}

$(\"#load\").html(\"img src=\'images/cnzz/2010829142847132.gif\'\");

$.ajax({
type:\"get\",
url:\"cnzz_online.php?fid=\" fid \"
$(\"#load\").html(\"\");
onloads();
$(\"#helloworld\").css(\"margin-left\",\"50px\");
}
}
});
}


function onloads(){
var flashvars = {\"data-file\":\"test.txt\"}; //这里是数据源
var params = {menu: \"true\",scale: \"noScale\",wmode:\"opaque\"};
swfobject.embedSWF(\"open-flash-chart.swf\", \"helloworld\", \"800px\", \"500px\",
\"9.0.0\", \"<a href=\"http://www.flexrain.cn/js/expressInstall.swf\" target=\"_blank\">http://www.flexrain.cn/js/expressInstall.swf</a>\", flashvars,params);
}


function _click(fid){
$(\"#helloworld\").html(\"img src=\'images/cnzz/loading45.gif\' style=\'margin-left:200px;margin-top:200px\'\");
$.ajax({
type:\"get\",
url:\"cnzz_online.php?fid=\" fid,
dataType:\"json\",
data:\"\",
success:function(res){
if(res == \"ok\"){
$(\"#helloworld\").html(\" \");
onloads();
$(\"#helloworld\").css(\"margin-left\",\"50px\");
//location.href=\'cnzz_right.php\'
}
}
});
}
回复

使用道具 举报

千问 | 2011-3-7 07:47:58 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">整个页面全部刷新了,重新发了一次请求,但是swf里面的内容没变。我用的jsp方式,查了一下,根本就没走那个jsp,郁闷 缓存 清除缓存
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行