<script>
    $('body').on('change','#hide',function(){
        if (!confirm('Are you sure')) {
            return;
        }
        var section = $(this).data('section');
        var value = $(this).val();

        Fdata = new FormData();
        Fdata.append('section',section);
        Fdata.append('value',value);

        console.log(Fdata);
        try{

            loading();
		        // var form_data = new FormData(this);
		        $.ajax({
		            url: '{{url("/frontend/change-status")}}',
		            type: 'POST',
		            data: Fdata,
		            headers: {
			            'X-CSRF-TOKEN': '{{ csrf_token()}}'
			        },
		            contentType: false,
			        processData: false,
			        cache: false,
			        // dataType: 'json',

		        })
		        .done(function (res) {
		           swal(res.text,res.cls);
		        })
		        .fail(function () {
		            console.log("error");

		        }).always(function(){
		        	loading("stop");
		        });

        }catch(error){
            console.log(error);
        }
    });
</script>
