Thứ Ba, 3 tháng 9, 2013

Code Popup-under hiện sau trình duyệt cho website/Blogger

Published by Unknown on Thứ Ba, 3 tháng 9, 2013  | No comments

Cách 2. Code Popup-under hiện sau trình duyệt cho website/Blogger

Đặc điểm của file javarscripts.

  • Các popup-under sẽ tự động xuất hiện mà không cần phải đợi độc giả click vào một vị trí bất kỳ nào trên blogger của bạn.
  • Popup sẽ không xuất hiện trên các trình duyệt sử dụng các add on hay phần mềm chặn popup.

Cách thực hiện

Đối với blogspot
  • Đăng nhập vào blog
  • Vào bảng điều khiển Blogger
  • Vào bố cục (Layout) -> Thêm tiện ích (Add a widget) -> HTML/Javascript
  • Dán 1 trong 2 đoạn code dưới đây vào tiện ích HTML/Javascript vừa thêm (Ngoài ra bạn có thể dán nó trước thẻ </head> )
Đối với website:

Bạn chỉ cần dán nó trước thẻ </head> là ok

Đoạn 1:

<script>
function popup() {
var url = "http://ngheseovip.blogspot.com";
window.open(url);
popWin = window.open(page,'popWin');
popWin.blur();
window.focus();
}
popup();
</script>

Đoạn 2: 

<script>

//Pop-under window- By JavaScript Kit
//Credit notice must stay intact for use
//Visit http://javascriptkit.com for this script

//specify page to pop-under
var popunder="http://ngheseovip.blogspot.com"

//specify popunder window features
//set 1 to enable a particular feature, 0 to disable
var winfeatures="width=800,height=510,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"

//Pop-under only once per browser session? (0=no, 1=yes)
//Specifying 0 will cause popunder to load every time page is loaded
var once_per_session=0

///No editing beyond here required/////

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function loadornot(){
if (get_cookie('popunder')==''){
loadpopunder()
document.cookie="popunder=yes"
}
}

function loadpopunder(){
win2=window.open(popunder,"",winfeatures)
win2.blur()
window.focus()
}

if (once_per_session==0)
loadpopunder()
else
loadornot()

</script>

Filed in :
About the Author

Write admin description here..

0 nhận xét:

© 2013 dich vu seo. SEO UY TÍN Theme-junkie converted by Dịch vụ seo
DỊCH VỤ SEO. DỊCH VỤ SEO SEO.
back to top