js判斷來路是否是百度等搜尋索引進行彈窗或自動跳轉

來源:互聯網
上載者:User

標籤:來路跳轉   來路彈窗   

比如百度收錄了你的a,你希望從a站被點擊訪問後,再跳轉或彈出b站,可以用下面的方式.

當然可以直接用window.open() 快顯視窗,可以多個彈窗,也可以用form的方式.不過兩種方式,都有被360過濾的可能.

self.location 這個方式是轉向,不會被當成廣告過濾.

<script type="text/javascript">

$(function(){


var s=document.referrer;
//擷取來源地址
if(s.indexOf("baidu")>0)
//來源是否有baidu出現
//self.location="http://www.baidu.com/";//原視窗
document.getElementById(‘openWin‘).submit(); 
document.getElementById(‘openWin2‘).submit(); 
//window.open("http://www.taobao.com")
//window.open("http://www.360.com")
});
</script>
<form id="openWin" action="http://www.taobao.com" target="_blank" method="get"></form>
<form id="openWin2" action="http://www.360.com" target="_blank" method="get"></form>


本文出自 “上海藍蝸網路” 部落格,請務必保留此出處http://viqecel.blog.51cto.com/10859227/1859710

js判斷來路是否是百度等搜尋索引進行彈窗或自動跳轉

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.