i have two jquery one is
<script type="text/javascript">
$('#submitchart').click(function () {
// $.ajax({
// type: 'POST',
// url: 'WebForm1.aspx/fun1',
// data: JSON.stringify({ yearP: $('#yearValue').val() }),
// contentType: 'application/json;charset=utf-8',
// dataType: 'json',
// success: function (response) {
// alert(JSON.stringify(response.d));
// var data1 = response.d.split('*')[0];
// var data2 = response.d.split('*')[1];
// alert(data1);
// alert(data2);
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Student Info'
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Range(millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: 'students'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
credits: {
enabled: false
},
series: [{
name: 'Year 1800',
data: [107, 31, 635, 203, 2]
}, {
name: 'Year 1900',
data: [133, 156, 947, 408, 6]
}, {
name: 'Year 2012',
data: [1052, 954, 4250, 740, 38]
}]
});
});
});
//});
function Loadchart() {
$('#submitchart').click();
};
</script>
in above jquery when i remove ajax then when i click on button chart is display but when i add ajax and then i click on button chart not display
same with i done with this
<script type="text/javascript">
var strArray = "[['a', 9],['asdiwi', 3],['Mixasded nuts', 1],['Orasdanges', 6],['Asadpples', 8],['Peasadrs', 4],['Clementines', 4],['Reddish (bag)', 1],['Grapes (bunch)', 1]]";
//alert(strArray);
//alert(eval(strArray));
alert('u');
$('#Button5').click(function () {
$.ajax({
type: "POST",
url: "WebForm1.aspx/GetVo2", // the method we are calling
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (result) {
alert(result.d);
alert('u');
//start
strArray = result.d;
var myarray = eval(strArray);
$(function () {
$('#container').highcharts({
chart: {
type: 'pie',
options3d: {
enabled: true,
alpha: 45
}
},
title: {
text: 'Contents of Highsoft\'s weekly fruit delivery'
},
subtitle: {
text: '3D donut in Highcharts'
},
plotOptions: {
pie: {
innerSize: 100,
depth: 45
}
},
series: [{
name: 'Delivered amount',
data: myarray
}]
});
});
//end
}
});
});
function Loadchart() {
$('#Button5').click();
};
</script>
in this above jquery everything working fine data also correclty parse
like this
[[abc,'2'],[sad,23']]
and also
alert('u');
is called but chart is display
my question i use same style of using this
$('#Button5').click(function () {
same as
$('#submitchart').click(function () {
in 1st and 2nd function both .. in 1st function button working fine but in 2nd jquery button not working ..
my actual jquery is number two .. 1st jquery i just posted for reference.