execute the code if check box is checked in jquery

## IF CHECK BOX CHECKED THEN ONE BLOCK EXECUTE THE CODE , OTHERWISE OTHER BLOCK WILL EXECUTE THE CODE. $(‘#checkbox-id’).change(function() {         if(this.checked == true)         {             alert(“checked”);         }         else         {             alert(“unckecked”);         } });

how to load differ image depending on screen width

<script> if (document.documentElement.clientWidth > 940) {    document.write(‘<img class=”<?php echo “ligncenter size-full “.$imgInfo[$randno][id];?>” src=”<?php echo $imgInfo[$randno][src];?>” title=”<?php echo $imgInfo[$randno][title];?>” alt=”<?php echo $imgInfo[$randno][alt];?>” />’); } </script>

how to encode json data in php

Encode: json_encode( array(‘id’=>$i, ‘name’ => $row[‘name’]) ); Or $arr = array( ‘id’=>$i, ‘name’ => $row[‘name’], ); json_encode($arr); Decode: $decoded = json_decode($arr);

How to call two or more ajax request parallely in php

<script> $(document).ready(function() {     $(document).on(“click”, “._SP12_MR11″, function()     { var datastring = {‘DSUC’:SMJX_SMR_SUC,’SRCON’:SMJX_SRCH_ON, ‘LCNT’:SMJX_SMR_LST_CNT,};         $.when(             $.ajax({                 url:'<?php echo base_url().”search-ax-shwmre-st”;?>’,                 type: ‘POST’,                 data: datastring,                 success:function(rta) { // DO YPUR CODE-1                 }                     }),             $.ajax({                 url:'<?php echo base_url().”search-ax-shwmre-rd”;?>’,                 type: ‘POST’,               data: datastring,                success:function(rtb) {                 // … Read moreHow to call two or more ajax request parallely in php