I'm trying to only display the following code on a small screen:
<div align="center"><a href="/mobile/mobile_home.asp">Mobile Site</a></div>
So the full code is:
<script>
<!-- if (screen.width <= 699){
document.write("<div align=\"center\"><a href=\"/mobile/mobile_home.asp\">Mobile Site</a></div>")}
//-->
</script>
If I just do the below, it works.
<script>
<!-- document.write("<div align=\"center\"><a href=\"/mobile/mobile_home.asp\">Mobile Site</a></div>")}
//-->
</script>
Apparently, I have some syntax or something wrong with the if statement. Or is there a simpler way of doing this? Little help. Thanks.
Aucun commentaire:
Enregistrer un commentaire