Welcome to WebmasterWorld Guest from 54.147.134.218

Forum Moderators: open

Message Too Old, No Replies

Issue on download button

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

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 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>
9:15 am on Apr 24, 2014 (gmt 0)

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 0


Only download is creating problem here...
11:39 am on Apr 24, 2014 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts: 4966
votes: 10


What happens in IE11? Does it show an error?
11:47 am on Apr 24, 2014 (gmt 0)

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 0


Nothing is happening....If I click the download button, It doesn't respond....downloading is not working
1:32 pm on Apr 24, 2014 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts: 4966
votes: 10


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.
4:19 pm on Apr 24, 2014 (gmt 0)

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 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
4:27 pm on Apr 24, 2014 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts: 4966
votes: 10


Try adding some space around the "return":
if(window.DOMParser) return (new DOMParser).parseFromString(b,"text/xml");
4:41 pm on Apr 24, 2014 (gmt 0)

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 0


Still it is throwing syntax error in the below line

if(window.DOMParser) return (new DOMParser).parseFromString(b,"text/xml");
4:55 pm on Apr 24, 2014 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts: 4966
votes: 10


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;
}
5:26 pm on Apr 24, 2014 (gmt 0)

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 0


Thanks for help!

It throws syntax error from the below line now

var _parsedresult = _newdp.parseFromString(b, "text/xml");
5:39 pm on Apr 24, 2014 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts: 4966
votes: 10


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?
5:44 pm on Apr 24, 2014 (gmt 0)

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 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");
5:50 pm on Apr 24, 2014 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts:4966
votes: 10


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.
6:02 pm on Apr 24, 2014 (gmt 0)

Junior Member

joined:Mar 1, 2013
posts: 53
votes: 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...]
6:17 pm on Apr 24, 2014 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts:4966
votes: 10


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members