I have two separate .inc file which I would like to alternately show based on whether a DIV is shown or hidden (mobile [phones/tablets] or desktop)
Here is my code which is in the BODY:
<script>
$(function () {
if ($('#leftNavCustom').css('display') == 'block') {
alert('mobile');
<!-- #include virtual ="includeNav/msMobile.inc" -->
}
if ($('#leftNavCustom').css('display') == 'none') {
alert('desktop');
<!-- #include virtual ="includeNav/msDesktop.inc" -->
}
});
</script>
If I remove the two #include line, the alert works fine but with the above code, it's neither displaying the .inc contents nor is it showing me the alert.
How can I modify the above code to work correctly?