• 15-11-2012, 14:28:27
    #1
    Merhabalar

    Web siteme mobile ile girişleri JAVASCRİPT ile başka bir siteye yönlendirmek istiyorum.

    .htaccess ve php ile yapabiliyorum bunu fakat bana .js lazim.

    Lütfen yardımcı olunuz.
  • 18-11-2012, 11:18:05
    #2
    Hocam Ekran Genişlik ve Yüksekliğinine göre yapabilirsiniz.
    var gen=window.screen.width;
    var yuk=window.screen.height;
    if(gen==1366 && yuk==768) window.location="yonleneceksayfa.html";
    gibi yapabilirsiniz.
  • 21-12-2012, 21:31:55
    #3
    dalga mi geçiyorsun mobile yönlendirme dedim
  • 24-12-2012, 18:58:35
    #4
    Tam deneyemedim, cep telefonda denedim tek ve çalıştı. Bu kod blogspot.com da kullanılıyor, ben kodu alıp biraz değiştirdim.
    <script type="text/javascript">
        var a = navigator,
            b = "userAgent",
            c = "indexOf",
            f = "&m=1",
            g = "(^|&)m=",
            h = "?",
            i = "?m=1";
    
        function j() {
            var d = window.location.href,
                e = d.split(h);
            switch (e.length) {
                case 1:
                    return d + i;
                case 2:
                    return 0 <= e[1].search(g) ? null : d + f;
                default:
                    return null
            }
        }
        if (-1 != a[b][c]("Mobile") && -1 != a[b][c]("WebKit") && -1 == a[b][c]("iPad") || -1 != a[b][c]("Opera Mini") || -1 != a[b][c]("IEMobile")) {
    		alert('Mobile');
    		window.location="mobile.html";
        };
    </script>
  • 17-02-2013, 22:09:28
    #5
    Bu yönlendirme bir sitemde gerekli oldu. Kodu düzenledim örnek Kod:
    <script type="text/javascript"><!--
    var a = navigator,b = "userAgent",c = "indexOf"
    if(-1!=a[b][c]("Mobile") && -1!=a[b][c]("WebKit") && -1==a[b][c]("iPad") || -1!=a[b][c]("Opera Mini") || -1!=a[b][c]("IEMobile"))
    {window.location="http://www.remagx.com/?m=1";}; 
    --></script>
    Yönlenecek adresi değiştirin. Sağdaki ?m=1 formatı blogger ın mobil tema geçiş özelliğidir. Sizin ?m=1 kullanmanıza gerek yok.
  • 18-02-2013, 01:31:48
    #6
    http://detectmobilebrowsers.com/ Sitesinden 16 farklı dilde mobil yönlendirme kodunu indirebilirsiniz.
  • 18-02-2015, 11:56:46
    #7
    RemagX adlı üyeden alıntı: mesajı görüntüle
    Tam deneyemedim, cep telefonda denedim tek ve çalıştı. Bu kod blogspot.com da kullanılıyor, ben kodu alıp biraz değiştirdim.
    <script type="text/javascript">
        var a = navigator,
            b = "userAgent",
            c = "indexOf",
            f = "&m=1",
            g = "(^|&)m=",
            h = "?",
            i = "?m=1";
    
        function j() {
            var d = window.location.href,
                e = d.split(h);
            switch (e.length) {
                case 1:
                    return d + i;
                case 2:
                    return 0 <= e[1].search(g) ? null : d + f;
                default:
                    return null
            }
        }
        if (-1 != a[b][c]("Mobile") && -1 != a[b][c]("WebKit") && -1 == a[b][c]("iPad") || -1 != a[b][c]("Opera Mini") || -1 != a[b][c]("IEMobile")) {
    		alert('Mobile');
    		window.location="mobile.html";
        };
    </script>

    teşekkür ederim işime yaradı üstadım