http://jonsion.iteye.com/blog/552921
<script type="text/javascript">
$(document).ready(function() {
//$("#pb1").progressBar();
//$("#pb2").progressBar({ barImage: 'images/progressbg_yellow.gif'} );
//$("#pb3").progressBar({ barImage: 'images/progressbg_orange.gif', showText: false} );
//$("#pb4").progressBar(65, { showText: false, barImage: 'images/progressbg_red.gif'} );
//$(".pb5").progressBar({ max: 2000, textFormat: 'fraction', callback: function(data) { if (data.running_value == data.value) { alert("Callback example: Target reached!"); } }} );
//$("#uploadprogressbar").progressBar();
initcheckbox();
clickEvent();
});
function initcheckbox(){
$.getJSON("http://localhost:8088/JQuery/servlet/DataJson",callbackFun);
}
function callbackFun(data){
if(null!=data){
for(var i=0;i<data.listData.length;i++){
$("#testcheck").append("<div>"+"<input type='checkbox' value='"+ data.listData[i] +"'> " + data.listData[i]+"</div>");
}
}
}
function clickEvent(){
//alert("000000000");
$("#testbutton").click(getCheckBoxValue);
}
function getCheckBoxValue(){
var checkStr = "";
$("div[id=testcheck] input[type=checkbox][checked]").each(function(){
//alert($(this).val());
if(""!=checkStr){
checkStr = checkStr + "," + $(this).val();
}else{
checkStr = $(this).val();
}
});
alert("checkStr==========="+checkStr);
$.getJSON("http://localhost:8088/JQuery/servlet/CopyOfDataJson?testvalue="+checkStr,function(data){alert("it is ok");});
}
</script>