-1

I have a problem where I want to make my website when you first accessed through a mobile phone message to download the app or website.

What is needed? Can anyone help me solve my problem?

1 Answers1

0

Javascript for example: You can set a cookie.

<script>
var tehDiv = document.getElemenbyId('adiv');
if (localStorage.getItem('firstTime'){
theDiv.innerHTML='';
}else{
localStorage.setItem('firstTime', 'no');
theDiv.innerHTML='The html that shows download app buttons';
}
</script>

<body>

blablablabla
<div id="adiv">Here will be placed download buttons or not</div>

If need to know if is a mobile there are many scripts to that. For example this one: Detecting iOS / Android Operating system

Community
  • 1
  • 1
Luis Gar
  • 457
  • 1
  • 4
  • 18