Hergun sayfada birkere gozuken işe yarar bir kod. Acılış sayflarında intro yerine kullanılabilir.

  1.  /* This script and many more are available free online at The JavaScript Source!! http://enesuysal.com Created by: Enes UYSAL | */
  2. var today = new Date();
  3. function checkCookie() { username=getCookie('username');
  4. if (username!=null && username!="") {
  5. if(username==today.getUTCDay()){
  6. //alert("Bugun " +username+" tarihler esit" ) }
  7. else { //alert("Bugun " +username+" tarihler esit" );
  8. Popup.showModal('modal10');
  9. setCookie('username',today.getUTCDay(),365); } }
  10. else { Popup.showModal('modal10');
  11. setCookie('username',today.getUTCDay(),365);
  12. if (username!=null && username!="") { setCookie('username',today.getUTCDay(),365);
  13. alert("il kez olu?tu" );
  14.  } } }
  15. function getCookie(c_name) {
  16. if (document.cookie.length>0)
  17. { c_start=document.cookie.indexOf(c_name + "=");
  18. if (c_start!=-1)
  19. { c_start=c_start + c_name.length+1;
  20. c_end=document.cookie.indexOf(";",c_start);
  21. if (c_end==-1) c_end=document.cookie.length;
  22. return unescape(document.cookie.substring(c_start,c_end));
  23. } } return "";
  24. }
  25. function setCookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toUTCString()); } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } addLoadEvent(function() { checkCookie(); });

Bu makale 513 kere okundu.

Share to Facebook Share to Twitter Share to MySpace Stumble It Share to Reddit Share to Delicious More...

 

   

javascript-hosgeldin-mesaji



Linkler



Son Yorumlar

  • Erhan

    tam aradığım konu ama eksik...

  • zuleyha

    burcumu nasil okuyabilirim ...

  • kerem bora

    Maili dün yazmıştım, bugün ...

Twitter