garnold

Works great in FireFox but not in IE

Recommended Posts

So the code below will load a chart perfect once the page is rendered in Firefox but this same page in IE will not. I have to push the button I created to run the function again for IE to work. Seems like the chart is not rendered in time for the XML or something? Not really sure what to change here? Sorry for the HTML textarea and break points but it was the only way I could think of getting all my code up here for you to look at. Thanks

 

 

 

 

<%@ Control Language="C#" ClassName="MashUpChart" %>

 

 

 

 

 

 

 

 

 

 

value="Get Oppos" />

 

 

 

 

 

 

 

 

getData();

 

 

 

function getData()

 

{

 

var req = new XMLHttpRequest();

 

req.open('GET', 'http://w2003stdbase:3333/SlxClient/mashuphandler.ashx?mashup=OppoMash&Result=SelectOppos', true, 'Admin','');

 

req.onreadystatechange = function (aEvt) {

 

if (req.readyState == 4) {

 

if(req.status == 200)

 

loadChart(req.responseXML);

 

else

 

dump("Error loading page");

 

}

 

};

 

 

 

req.send(null);

 

}

 

 

 

function loadChart(data)

 

{

 

if (data != undefined){

 

var results = data.getElementsByTagName('result');

 

var acctName = "";

 

 

 

var xml = "";

 

 

 

for(var x = 0; x < results.length; x++){

 

var oppo = results.item(x);

 

var oppoId = oppo.getElementsByTagName('oppo_Id')[0].firstChild.nodeValue;

 

var description = oppo.getElementsByTagName('acct_AcctName')[0].firstChild.nodeValue + ": " + oppo.getElementsByTagName('oppo_Description')[0].firstChild.nodeValue;

 

var salesPotential = oppo.getElementsByTagName('oppo_SalesPotential')[0].firstChild.nodeValue;

 

xml += "";

 

}

 

 

 

xml += "";

 

 

 

var chart1 = new FusionCharts("smartparts/dashboard/Column2D.swf", "chart1Id", "500", "300", "0", "1");

 

chart1.setTransparent(true);

 

chart1.setDataXML(encodeURI(xml));

 

chart1.render("chart1div");

 

}

 

}

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now