Sign in to follow this  
perfri

Page title changes when clicking chart

Recommended Posts

I have a page that generates a fusionchart using javascript. The chart is not clickable in any manner, it is a static chart. The page is built up with different tabs that specifies different time periods. The chart is updated with new data by using AJAX when a user clicks on a tab with a new time period.

When my page is loaded for the first time or the page is reloaded and a user clicks in the chart the page title remains the same, but when a user has updated the chart via a AJAX call and then clicks somewhere in the chart the page title changes to a page internal a href name instead.

Could this be related to Fusioncharts in some way?

Share this post


Link to post
Share on other sites
Guest Rajroop

Hey there,

 

 

 

Welcome!

 

 

 

We'll have to find out if it is, in fact, related to FusionCharts. Could you please offer your code sample at [email protected] for this? Please make sure to quote/refer to this thread in your mail.

 

 

 

I'll be looking forward to your reply. :)

Share this post


Link to post
Share on other sites

I had this problem, I had to make a fix to the render function in the FusionCharts.js, aparently the render function was changing the document.title in the DOM.

 

 

 

FIX:

 

 

 

render: function(elementId, varPageTitle) {

 

//First check for installed version of Flash Player - we need a minimum of 8

 

if (varPageTitle == null)

 

varPageTitle = document.title;

 

if ((this.detectFlashVersion == 1) && (this.installedVer.major < 8)) {

 

if (this.autoInstallRedirect == 1) {

 

//If we can auto redirect to install the player?

 

var installationConfirm = window.confirm("You need Adobe Flash Player 8 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. Please click on Ok to install the same.");

 

if (installationConfirm) {

 

window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";

 

} else {

 

return false;

 

}

 

} else {

 

//Else, do not take an action. It means the developer has specified a message in the DIV (and probably a link).

 

//So, expect the developers to provide a course of way to their end users.

 

//window.alert("You need Adobe Flash Player 8 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. ");

 

return false;

 

}

 

} else {

 

//Render the chart

 

var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;

 

// If loaded in IE and scaleMode and width/height specified in %, load the chart using onload event

 

if (this.getVariable('scaleMode').search(/noscale/i) >= 0 &&

 

(this.getAttribute('width').search("%") > 0 ||

 

this.getAttribute('height').search("%") > 0)) {

 

//store current object reference

 

var obj = this;

 

if (window.addEventListener) {

 

//add onload event on firefox

 

window.addEventListener("load", function()

 

{ n.innerHTML = obj.getSWFHTML(); document.title = varPageTitle; }, false);

 

} else if (window.attachEvent) {

 

//add onload event on IE

 

window.attachEvent("onload", function()

 

{ n.innerHTML = obj.getSWFHTML(); document.title = varPageTitle; });

 

} else {

 

// if all onload fails fails

 

n.innerHTML = this.getSWFHTML(); document.title = varPageTitle;

 

}

 

} else {

 

//Normal case. Instantly load the chart

 

n.innerHTML = this.getSWFHTML(); document.title = varPageTitle;

 

}

 

 

 

//Added

compatibility

 

//Check if it's added in Mozilla embed array or if already exits

 

if (!document.embeds[this.getAttribute('id')] && !window[this.getAttribute('id')])

 

window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));

 

//or else document.forms[formName/formIndex][chartId]

 

return true;

 

}

 

}

 

 

 

 

 

perfri (5/24/2010)
I have a page that generates a fusionchart using javascript. The chart is not clickable in any manner, it is a static chart. The page is built up with different tabs that specifies different time periods. The chart is updated with new data by using AJAX when a user clicks on a tab with a new time period.

 

 

 

When my page is loaded for the first time or the page is reloadedand a user clicks in the chart the page title remains the same, but when a user has updated the chart via a AJAX call and then clicks somewhere in the chart the page title changes to a page internal a href name instead.

 

 

 

Could this be related to Fusioncharts insome way?

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Thanks for sharing your idea.

Keep smiling and keep FusionCharting. :)

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