Google Visualization(PieChart / LineChart)Jquery Ajax Firefox的问题 [英] Google Visualization (PieChart/LineChart) Jquery Ajax Firefox issue

查看:143
本文介绍了Google Visualization(PieChart / LineChart)Jquery Ajax Firefox的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经遇到了一个Firefox的错误,并已遍及搜索,似乎没有找到我遇到的问题的答案。



我的程序在Chrome和IE浏览器中运行良好,但是iframe图表在Firefox中不起作用。



I使用一个处理程序,然后jquery.ajax抓住数据并运行脚本。

  jQuery.ajax({
url:jQuery(this).attr(href),
data:data,
dataType:'script'
});

data =饼图的所有信息以及表的所有信息。表很好,但饼图iframe是空的。如果我点击退格键,那么这个饼图就会显示出来。这几乎就像在firefox中超出了这个饼图。



数据看起来像这样,除了我自己的数据。这是从处理程序传递给ajax调用。

  var data = new google.visualization.DataTable(); 
data.addColumn('string','Task');
data.addColumn('数字','每小时');
data.addRows(5);
data.setValue(0,0,'Work');
data.setValue(0,1,11);
data.setValue(1,0,'吃');
data.setValue(1,1,2);
data.setValue(2,0,'Commute');
data.setValue(2,1,2);
data.setValue(3,0,'看电视');
data.setValue(3,1,2);
data.setValue(4,0,'Sleep');
data.setValue(4,1,7);

var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data,{width:450,height:300,title:'My Daily Activities'});

有其他人遇到过类似的问题吗?我知道数据传递正确,一切都收到了,但它似乎像Firefox不与iframes打好。



如果有人有任何的建议或想法,将是伟大的



谢谢

解决方案

你的帖子说,问题是只有在FF我找到了解决办法。在页面上导入JQuery

 < script src =../ GoogleJs / jquery-1.4.2.min.js类型= 文本/ JavaScript的 >< /脚本> 

然后添加标签

 drawVisualization()
}

});

其中drawVisualization()是绘图函数。
它像魅力一样... ...

感谢您注意到FF是问题

I have run into a bug with firefox and have searched all over and have not seemed to find the answer to an issue I have been having.

My program works great in Chrome and IE, but the iframe charts are not working in firefox.

I'm using a handler and then jquery.ajax to grab at the data and run the script.

jQuery.ajax({
                    url: jQuery(this).attr("href"),
                    data: data,
                    dataType: 'script'
});

data = all the information for a piechart and all the information for a table. The table is fine, but the pie chart iframe is empty. If I hit the backspace button then the piechart will show up. It's almost like the piechart is overshooting in firefox.

the data looks like this except with my own data. This is getting passed from the handler to the ajax call

    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Task');
    data.addColumn('number', 'Hours per Day');
    data.addRows(5);
    data.setValue(0, 0, 'Work');
    data.setValue(0, 1, 11);
    data.setValue(1, 0, 'Eat');
    data.setValue(1, 1, 2);
    data.setValue(2, 0, 'Commute');
    data.setValue(2, 1, 2);
    data.setValue(3, 0, 'Watch TV');
    data.setValue(3, 1, 2);
    data.setValue(4, 0, 'Sleep');
    data.setValue(4, 1, 7);

    var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
    chart.draw(data, {width: 450, height: 300, title: 'My Daily Activities'});

Has anybody else come across a similar issue? I know the data is passed right and everything is received, but it just seems like Firefox is not playing nice with the iframes.

If anyone has any suggestions or thoughts, that would be great

Thanks

解决方案

Just few hours after I read your post that the problem is only in FF i found the solution. Import JQuery on your page

<script src="../GoogleJs/jquery-1.4.2.min.js" type="text/javascript"></script>

then add a tag

$(document).ready(function () {
      Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

      function EndRequestHandler(sender, args) {
        drawVisualization()
      }

    });

where drawVisualization() is the drawing function. It works like charm...

p.s. thank you for noticing that FF was the problem

这篇关于Google Visualization(PieChart / LineChart)Jquery Ajax Firefox的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆