Hey guys, its me again.
So I have a checkbox and its styled as iPhone style and when I click it I want it to run an ajax request.
So HTML code:
JavaScript:
And it clearly not doing the request, I'm showing XMLHTTP Requests on console and nothing shows.
I also tried $('input') , $('#click') and such things but it didn't work.
Any clues?
Thanks
So I have a checkbox and its styled as iPhone style and when I click it I want it to run an ajax request.
So HTML code:
HTML:
<label class="switch" style="padding:10px;">
<input <?php if($maintenance == 1){ echo 'checked'; } ?> type="checkbox">
<span id="click"></span>
</label>
Code:
$(document).ready(function(){
$('label.switch').click(function(){
$.ajax({
url:'system/js/maintenance.php',
type:'POST',
success:function(result){
alert('done');
}
});
});
});
And it clearly not doing the request, I'm showing XMLHTTP Requests on console and nothing shows.
I also tried $('input') , $('#click') and such things but it didn't work.
Any clues?
Thanks