I am using sammy javascript framework. Problem is when I click over below anchor browser take me on top of page …. How can I prevent this….
Here is html anchor
<a href="#/duplicate/Chart1">Duplicate</a>
and here is JS sammy listner
this.get('#/duplicate/:id', function(context) {
chartName=this.params['id'];
for(i=0;i<chartJSONS.length;i++){
if(chartJSONS[i].chart.renderTo==chartName){
var obj = jQuery.extend(true, {}, chartJSONS[i]);
var dupChart=obj.chart.renderTo+"_duplicate";
obj.chart.renderTo=dupChart;
chartJSONS[chartJSONS.length++]=obj;
}
}
$('#chart').html('');
createCharts();
return false;
});
Any help is highly appreciated…
You need to do something like this:
I suggest you to add a class to every a element you want to handle like this: