Welcome to WebmasterWorld Guest from 54.147.10.72

Forum Moderators: open

Message Too Old, No Replies

Issue on download button

     

Gowri pandiyan

9:14 am on Apr 24, 2014 (gmt 0)



Hi Gurus,

I'm using amchart in my page, here viewers can download the result which is shown in a pie chart. Its working great in all browsers as I expected,But not in IE11 :(.

I couldn't figure out the solution. Kindly help me out to find a solution for this issue.

Here is the code.

<p class="Three-Dee1">Your result:</p>


<div id="chartdiv"></div>
<img id="image1" src="http://www.cross-tab.us/geetanjali/BMI/Combo/hand3.png">


<script type="text/javascript" src="http://www.cross-tab.US/geetanjali/BMI/Combo/amcharts.js"></script>
<script type="text/javascript" src="http://www.cross-tab.US/geetanjali/BMI/Combo/pie.js"></script>
<script type="text/javascript" src="http://www.cross-tab.us/geetanjali/BMI/light.js"></script>

<script type="text/javascript" src="http://www.cross-tab.us/geetanjali/BMI/Combo/amexport_combined.js"></script>

<style>
.Three-Dee{
Position:relative;
bottom: 20px;
left: 10px;



font-family: Segoe UI Light;
line-height: 1em;
color: #7FBA00;
font-weight:bold;
font-size: 25px;

}



.Three-Dee1{

font-family: Segoe UI Light;
line-height: 1em;
color: #C94F00;
font-weight:bold;
font-size: 35px;

}


#chartdiv {#chartdiv {
width: 100%;
height: 400px;
font-size: 11px;
font-family:Segoe UI Light;
}
width: 100%;
height: 400px;
font-size: 11px;
font-family:Segoe UI Light;
}</style>

<script>
function button_click()
{
if(document.getElementById('chartdiv')!=null){document.getElementById('chartdiv').style.display='inline';}


}


var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",

"theme": "light",
"marginBottom": 0,
"height": 350,
"fontFamily": "Segoe UI Light",
"legend": {
"markerType": "circle",
"valueText": "$[[value]]",
"position": "right",
"marginRight": 80,
"fontFamily": "Segoe UI Light",
"autoMargins": false
},

"dataProvider": [{

"country": "Books",

"litres": 22


}, {
"country": "e-Books",
"litres": 33
}, {
"country": "Research requests",
"litres": 44
}, {
"country": "Chat",
"litres": 33
}],
"valueField": "litres",
"titleField": "country",
"labelText": "[[title]] $[[value]] ([[percents]]%)",
"balloonText": "[[title]] $[[value]]([[percents]]%)",
"exportConfig": {
"menuTop":"0px",
"menuRight":"125px",
"menuItems": [{
"icon": 'http://www.cross-tab.US/geetanjali/BMI/Combo/download3.png',
"format": 'png'
}]
}
});





</script>

Gowri pandiyan

9:15 am on Apr 24, 2014 (gmt 0)



Only download is creating problem here...

Fotiman

11:39 am on Apr 24, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



What happens in IE11? Does it show an error?

Gowri pandiyan

11:47 am on Apr 24, 2014 (gmt 0)



Nothing is happening....If I click the download button, It doesn't respond....downloading is not working

Fotiman

1:32 pm on Apr 24, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



I'd try opening IE's developer tools and see if you can spot anything unusual (JavaScript errors, etc.). Unfortunately, I don't have access to AmCharts.

Gowri pandiyan

4:19 pm on Apr 24, 2014 (gmt 0)



Thanks Fotiman!

I tried opening in IE's developer tool,It shows there is a syntax error in the below line.

if(window.DOMParser)return(new DOMParser).parseFromString(b,"text/xml");

Please let me know what could be the issue here

Fotiman

4:27 pm on Apr 24, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Try adding some space around the "return":
if(window.DOMParser) return (new DOMParser).parseFromString(b,"text/xml");

Gowri pandiyan

4:41 pm on Apr 24, 2014 (gmt 0)



Still it is throwing syntax error in the below line

if(window.DOMParser) return (new DOMParser).parseFromString(b,"text/xml");

Fotiman

4:55 pm on Apr 24, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



the "new DOMParser" is missing parenthesis. Try this:

if(window.DOMParser) return (new DOMParser()).parseFromString(b,"text/xml");

If that doesn't work, I'd try splitting it up into multiple lines to better identify what exactly is causing the problem:


if (window.DOMParser) {
var _newdp = new DOMParser();
var _parsedresult = _newdp.parseFromString(b, "text/xml");
return _parsedresult;
}

Gowri pandiyan

5:26 pm on Apr 24, 2014 (gmt 0)



Thanks for help!

It throws syntax error from the below line now

var _parsedresult = _newdp.parseFromString(b, "text/xml");

Fotiman

5:39 pm on Apr 24, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Is it possible that your variable b doesn't contain properly formatted XML, and maybe the error you're seeing is coming from trying to parse it?

Gowri pandiyan

5:44 pm on Apr 24, 2014 (gmt 0)



I just read the below in a website

Internet Explorer uses the loadXML() method to parse an XML string, while other browsers use the DOMParser object.

So code become as below

if (window.DOMParser) {
var _newdp = new DOMParser();
var _parsedresult = _newdp.parseFromString(b, "text/xml");
return _parsedresult;
}

else // Internet Explorer
{
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
var parse1 = xmlDoc.loadXML(b);
return parse1;
}

But I'm getting syntax error from the below line. :( Please correct me if I'm wrong

var _parsedresult = _newdp.parseFromString(b, "text/xml");

Fotiman

5:50 pm on Apr 24, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



IE has supported DOMParser since IE9.
[msdn.microsoft.com...]

So IE8 and older won't work with the DOMParser method, but IE9+ should work. Check to see that b contains valid XML.

Gowri pandiyan

6:02 pm on Apr 24, 2014 (gmt 0)



I couldn't figure out whether b contains valid XML....

The below line contains the original code....Could you please take a look into this?

[cross-tab.us...]

Fotiman

6:17 pm on Apr 24, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



I can't tell from that if your xml is valid, but what you could do is add a breakpoint on the line that does parseFromString, then in the "Locals" tab, examine the value of b, maybe copy it and paste it into an XML validator.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month