Click here to Skip to main content
15,918,243 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone .
I have two buttons that draw a graph.
The first one draws a graph with some values and the second one draws a graphic with other values.Both graphs are drawn in the same location on my HTML page.
The problem is that the graphs overwrites if i press the both buttons
consecutively and i don't refresh the page.


$("#buttonA").click(function(){
deseneazaGrafic(jsonData.Antena3);
});

and the second button

$("#buttonP").click(function(){
deseneazaGrafic(jsonData.ProTV);
});

Thanks a lot !
Posted

Use Ajax to create the element.

Load the graph into a
- since it's AJAX it will replace the existing content.
 
Share this answer
 
$("#buttonA").click(function(e){
e.preventDefault();
deseneazaGrafic(jsonData.Antena3);
});

or

$("#buttonP").click(function(){
deseneazaGrafic(jsonData.ProTV);
return false;
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900