Sign in to follow this  
Guest Basundhara Ghosal

Null is null or not an object in IE 8

Recommended Posts

Hi

 

I have an GWT application in which charts are loaded one after the other. Now I have a problem , if before the first chart is loaded completely if I try to load next by some event , I get a java script error sying "null is null or not an object" . I use Fusion charts v 3.1 (lincensed one which my company owe). This is a serious problem causing only in IE 7 or 8 . When I do the same thing in firefox , it works fine with no java script error . Could any one please suggest me regarding this. I have attached the error scrren shot for reference .

 

 

 

Xml is attached with this

 

 

 

Thanks and regards

 

Sachin

post-9072-128441585428_thumb.png

xml.txt

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Sachin,

In case the chart tries to get render in a div which is not defined, it throws an error "null is null or not an object".

Could you please re-confirm the same?

Also, could you please send us the HTML code that you are using to render the chart?

Awaiting your reply.

Share this post


Link to post
Share on other sites

We are having a similar problem lately in IE8. While running adobe flash 10.1.53.64 we have the following problem (see attachments). Some chart pages render properly while others don't and I cannot tell where this 'null' is null or not an object is coming from. I am including a sample of the code segment that is used on the page.

post-3697-128441586088_thumb.jpg

post-3697-128441586114_thumb.jpg

codeSample.txt

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Richard,

The div-id that you are using to define the DIV is :

Ref.- <div id="chart<%=mDivCount%>div" align="center">

While the div-id that you are using to render the chart is :

 

Ref.- myChart<%=mDivCount%>.render("Chart<%=mDivCount%>div");

As the div-ids('chart<%=mDivCount%>div') is not matching, the Div is not getting defined properly.

As a result the chart is failing to render.

Share this post


Link to post
Share on other sites

Hi,

 

 

 

This seems to be a case-sensitive issue..so far I can see..

 

 

 

This is your code:

 

 

 

<div id="chart<%=mDivCount%>div" align="center">

 

You do not have Adobe Flash installed and therefore will not be able to see the Gauge.

 

</div>

 

<script type="text/javascript">

 

var myChart<= new FusionCharts("../FGv3/HLinearGauge.swf", "myChart<%=mDivCount%>Id", "400", "80", "0", "0");

 

myChart<setDataURL("./Data_List_DSMr_Growth.asp?DSM=<<%=trim(rsDSM.Fields.Item("SalesTerritory").Value)%>&Prov=<%=trim(rsDSM.Fields.Item("Province").Value)%>");

 

myChart<render("Chart<%=mDivCount%>div");

 

</script>

 

 

 

 

 

Say for instance if mDivCount iterates through Please note the line:

 

 

 

<div id="chart<%=mDivCount%>div" align="center">

 

 

 

 

 

It says that there would be divs with ids chart1div,chart2div,chart3div,chart4div,chart5div...

 

 

 

Please note the small letter c in all chartxdiv.

 

 

 

Now when you are calling render() function

 

 

 

myChart<render("Chart<%=mDivCount%>div");

 

 

 

 

 

please note that you are asking to render to the target div having name Chart1div,Chart2div,Chart3div,Chart4div,Chart5div...

 

 

 

NOTE the C in capital in this case.

 

 

 

 

 

Internally the renderer function will try search for a Div with id "Chart1div" which the browser would fail to provide as it only has "chart1div" (note the capital C and lower case c)...

 

 

 

 

 

hence you are sure to get a 'null' object...(object not found = null object) and you can not set innerHTML to a null DOM Object.

 

 

 

Hence, the error.

 

 

 

 

 

Could you please try once setting the code to this...very small change invisible to human eye...

 

 

 

 

 

<div id="chart<%=mDivCount%>div" align="center">

 

You do not have Adobe Flash installed and therefore will not be able to see the Gauge.

 

</div>

 

<script type="text/javascript">

 

var myChart<= new FusionCharts("../FGv3/HLinearGauge.swf", "myChart<%=mDivCount%>Id", "400", "80", "0", "0");

 

myChart<setDataURL("./Data_List_DSMr_Growth.asp?DSM=<<%=trim(rsDSM.Fields.Item("SalesTerritory").Value)%>&Prov=<%=trim(rsDSM.Fields.Item("Province").Value)%>");

 

myChart<render("chart<%=mDivCount%>div");

 

</script>

Share this post


Link to post
Share on other sites

From the problem screenshot, I found that you used GXT component. The reason of your problem is that GXT component use lazy render mechanism and the chart div has not been attached when render the FusionChart.

So, you must render the chart after the chart div is attached.

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