Sign in to follow this  
sunil233

Special characters

Recommended Posts

HI,

I am working on Drilldown charts,To call  drilldown chart I am using the javascript.

I have to pass year and region to the drilldown chart.But One of the Regions is Northen & Southern.When i pass the Region with Special characters(&) the part before & is only passed.Help me to fix this issue

 

function

updateChart(year, Region){

//Update the chart if it's loaded

if (cityChartLoaded){

//DataURL for the chart

var strURL = "Data_SalesByCity.aspx?year=" + year + "&Region=" + Region;

//Sometimes, the above URL and XML data gets cached by the browser.

//If you want your charts to get new XML data on each request,

//you can add the following line:

strURL = strURL +

"&currTime=" + getTimeForURL();

//getTimeForURL method is defined below and needs to be included

//This basically adds a ever-changing parameter which bluffs

//the browser and forces it to re-load the XML data every time.

//URLEncode it - NECESSARY.

strURL = escape(strURL);

//Get reference to chart object using Dom ID "CityDetails"

var chartObj = getChartFromId("CityDetails");

//Send request for XML

chartObj.setDataURL(strURL);

}

else {

//Show error

alert(

"Please wait for the charts to load.");

return;

}

Regards

Sunil

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Sunil,

If you're using dataURL method, you can directly embed the & character in your XML and then use it.

However if you are using dataXML method, you need to encode '&' character to '%26' - else, you'll get an error on many browsers.

 

Please have a look to the following link:-

Ref:-http://www.fusioncharts.com/docs/Contents/SpChar_Amp.html

Hope this helps. :)

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
Sign in to follow this