Sign in to follow this  
razborka

Ajax - PHP problem

Recommended Posts

Hi,

 

I got a problem using Ajax:

 

statistieken.php is the page in which I call the Ajax function.

 

grafieken.php is the page the Ajax function sends the variable to and this page's supposed to be printed in the divgraf DIV on the page statistieken.php. But I only get the word "Chart.".

 

 

 

I am new to Ajax, but the script works fine on other page.

 

Can someone please help me?

PHP-Ajax-problem.zip

Share this post


Link to post
Share on other sites

Hi,

Could you please use renderChartHTML() instead of renderChart() in the page :grafieken.php or whereever renderChart() is present?

NOTE : This is beacuse when you use renderChart() it returns HTML as well as JavaScript both combine to render the chart. Your ajac responseText contain both. But when you use ajax to set this to your "divgraf" (document.getElementById("divgraf").innerHTML=xmlHttp.responseText ) the JavaScript does not run/execute - Because a) JavaScript injected by JavaScript wont execute and a) AJAX functions through JavaScript. Hence, we need to use something which is JavaScript less. Here come the renderChartHTML() function handy which renderd only HTML elements that renders the chart.

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