This is failing but i dont know how to make it work.
I have a php array:
$swipe_list = array('customers.html', 'index.html', 'atr_backplane.html');
This is to know which pages have carousels and need touch support.
so i check the page in php and if its listed the JS will check its a touch device and write the addional js mobile file.
is it because the server script trys ti run before the js can detect at the client side??
<?php
if(in_array($selected, $swipe_list)){ ?>
<script type="text/javascript">
function isTouchDevice(){ document.write('<script type="text/javascript" src="js/jquery.mobile.custom.min.js"></script>')
}
</script>
<?php }?>
<?php if(!in_array($selected, $exclude_list)){
print '<script type="text/javascript" src="js/camera.js"></script>';
}
?>