<script type="text/javascript">
checkadid.count=0;
checkadid.adid="";
function checkadid(checkbox)
{
checkadid.adid=checkadid.adid.concat(checkbox.value);
if (checkbox.checked)
{
}
}
</script>
here my javascript static variable is checkadid.adid
since javascripts are weakly type there is no hard and fast rules you need to define variable as above
and i used this static variable access to following java script function
function load_table(){
var aid=checkadid.adid;
if(aid.length<=6){
alert("Please select at least 2 advertistment")
}
else{
window.location.href="<?php echo site_url('controller_c/compareVehicles/ctable'); ?>?aid="+aid;
}
}
static java script variable can access from any where within any javascript function
Click here to learn about javascript variables
Sunday, September 1, 2013
How to define static javascript variable
7:58 PM
No comments
0 comments:
Post a Comment