简体   繁体   English

Highchart导出图表不返回IE8或IE9中的图像

[英]Highchart Export chart not returning image in IE8 or IE9

Please don't say my question is repeat as it's not and as I search a lot since last 5 hours. 请不要说我的问题是重复的,因为不是,而且自最近5个小时以来我搜索了很多内容。 Very tough question but let see if someone can really help me out. 这是一个非常棘手的问题,但请问是否有人真的可以帮助我。

Ok so I am trying to get the generated chart- image url using Highchart Export server. 好的,所以我尝试使用Highchart Export服务器获取生成的图表图像URL。 My code is following and it's not returning any image url in IE8 or IE9. 我的代码正在执行,并且在IE8或IE9中没有返回任何图像URL。 As if you can see my hidden input element stays empty but working nicely with chrome, firefox, safari and even IE edge and IE10 but not IE8 & IE9. 好像您可以看到我的隐藏输入元素保持为空,但可以与chrome,firefox,safari甚至IE edge和IE10(而不是IE8和IE9)很好地工作。

Here is code, 这是代码,

var obj = {}, chart; var obj = {},图表;

chart = $('#graph<?php echo $i;?>').highcharts();
obj.svg = chart.getSVG();
obj.type = 'image/jpeg';
obj.width = 900;obj.height = 400;  
obj.async = true;
 <?php if (1) {?>  
$.ajax({
    type: 'post',
    url: chart.options.exporting.url,        
    data: obj, 
    success: function (data) {            
            //alert(data);
            var exportUrl = this.url,
            imgContainer = $("#imgContainer<?php echo $i;?>");                         
            var obj2 = exportUrl + data;
            document.getElementById('graphurl_<?php echo $i;?>').value = exportUrl + data;
            //var temp = exportUrl + data;
            //$("#graphurl_1").val(temp);

            //var imgie = document.getElementById("graphurl_1ie8");
            //imgie.setAttribute('src','jimils.com');
        }        
});

Not returning image url from export server please please help. 无法从导出服务器返回图片网址,请提供帮助。

CORS is possible in IE8 and IE9 through the XDomainRequest object. 通过XDomainRequest对象在IE8和IE9中可以进行CORS。 We do some feature detection here 我们在这里进行一些特征检测

 if (window.XDomainRequest) { /*old IE*/ var xdr = new XDomainRequest(); xdr.open("post", 'http://export.highcharts.com/?' + dataString); xdr.onload = function () { console.log(xdr.responseText); $('#container').html('<img src="http://export.highcharts.com/' + xdr.responseText + '"/>'); }; xdr.send(); } else { $.ajax({ // jQuery ajax call ... }) } 

See this fiddle: http://jsfiddle.net/gvaartjes/vLaa7k57/1/ 看到这个小提琴: http : //jsfiddle.net/gvaartjes/vLaa7k57/1/

Gert 格特

It is investigated by our developers. 我们的开发人员对此进行了调查。 Thanks for the reporting. 感谢您的举报。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM