1<script type= "text/javascript" >2 varUA =Navigator.userAgent.toLowerCase (); 3 if(/iphone|ipad|ipod/. Test (ua)) {4 //Alert ("iphone"); 5}Else if(/android/. Test (ua)) {6 varAlertmessage= "warm tip: You can download the latest version of the mobile app in the lower right corner of the menu! \ n This prompt only appears once! "7 varOnce_per_session=18 functionGet_cookie (Name) {9 varSearch = Name + "="Ten varreturnvalue = ""; one if(document.cookie.length > 0) { aoffset =document.cookie.indexOf (search) - if(offset! =-1) { -Offset + =Search.length theEnd = Document.cookie.indexOf (";", offset); - if(end = =-1) -End =document.cookie.length; -Returnvalue=unescape (document.cookie.substring (offset, END)) + } - } + returnreturnvalue; a } at functionalertornot () { - if(get_cookie (' alerted ') = = "){ - Loadalert () -Document.cookie= "alerted=yes" - } - } in functionLoadalert () { - Alert (alertmessage) to } + if(once_per_session==0) - Loadalert () the Else * Alertornot () $ }Panax Notoginseng</script>
It's actually a cookie recording.
JS Implementation popup pop-up box only pops up once