菜鸟教程小白 发表于 2022-12-12 13:36:07

android - 我想为商店中的 android 和 ios 应用程序生成相同的 URL


                                            <p><div>
            <aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
      <div class="d-flex fd-column fw-nowrap">
            <div class="d-flex fw-nowrap">
                <div class="flex--item wmn0 fl1 lh-lg">
                  <div class="flex--item fl1 lh-lg">
                        <b>已结束。</b>此问题不符合 <a href="https://stackoverflow.com/help/closed-questions" rel="noreferrer noopener nofollow">Stack Overflow guidelines</a> .它目前不接受答案。
                        
                  <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您应该指定是否要在您的网站上实现这一目标?
如果是,您可以使用 JQuery 来检测设备类型,并根据设备类型将用户重定向到所需的 URL(Play 商店或应用商店)</p>

<pre><code>&lt;script src=&#34;http://code.jquery.com/jquery-latest.min.js&#34; type=&#34;text/javascript&#34;&gt;&lt;/script&gt;

&lt;script&gt;
      $(document).ready(function (){
         if(navigator.userAgent.toLowerCase().indexOf(&#34;android&#34;) &gt; -1){
             window.location.href = &#39;https://play.google.com/store/apps/developer?id=WhatsApp+Inc.&amp;hl=en&#39;;
         }
         if(navigator.userAgent.toLowerCase().indexOf(&#34;iphone&#34;) &gt; -1){
             window.location.href = &#39;https://itunes.apple.com/in/app/whatsapp-messenger/id310633997?mt=8&#39;;
         }
      });
&lt;/script&gt;
</code></pre>

<p>如需更多帮助,请参阅:<a href="https://forum.webflow.com/t/redirect-to-app-store-or-play-store-if-webflow-website-opened-from-an-iphone-or-an-android-device/21350/6" rel="noreferrer noopener nofollow">https://forum.webflow.com/t/redirect-to-app-store-or-play-store-if-webflow-website-opened-from-an-iphone-or-an-android-device/21350/6</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于android - 我想为商店中的 android 和 ios 应用程序生成相同的 URL,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/45207021/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/45207021/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: android - 我想为商店中的 android 和 ios 应用程序生成相同的 URL