I want to start getting user location if his/her settiings is active. So I check if user setting allows using GPS then I check the allow checkbox using jquery prop
.
$(document).ready(function(){
//using javascript I check if map settings is active then:
enableGPS();
})
function enableGPS(){
$(".activateGPS").prop( "checked", true );
}
Uising jquery prop
I expect the code below to listen and response to changes but it seems not working. Is it because both above and below codes are wrapped inside DOM ready?
How can I pospone the block below to be ready for listening after the blocks above?
$(document).ready(function(){
$('.activateGPS').change(function() {
//Do something with coordinates
})
})
Finally I have to say this is a sample code. Please do not merge the third block into the second block. I want to know how to handle DOM ready blocks proiroties.