Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery('.brid').click(function(){
- count = jQuery('#yesfav').children().length;
- var brand_id = jQuery(this).attr('id');
- var status = jQuery(this).attr('checked');
- var url = "<?=$this->getUrl('brands/index/brands')?>";
- console.log('Brand: '+brand_id+' '+status+' '+url);
- jQuery.ajax({
- url: "<?=$this->getUrl('brands/index/brands')?>",
- type: 'POST',
- dataType: 'JSON',
- method: 'update',
- data:{
- 'brand_id': brand_id,
- 'status': status,
- },
- success: function(data) {
- if(data.status == '1'){
- jQuery('div[name='+data.brand+']').appendTo('#yesfav');
- counter();
- }else{
- jQuery('div[name='+data.brand+']').appendTo('#notfav');
- counter();
- }
- },
- error: function(data) {
- console.log('Error! - Nothing received!');
- },
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement