Advertisement
Guest User

PesquisaCorrentista

a guest
May 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*** Já esta no portal
  2. function setCookie(cname, cvalue, exdays) {
  3.     var d = new Date();
  4.     d.setTime(d.getTime() + (exdays*24*60*60*1000));
  5.     var expires = "expires="+ d.toUTCString();
  6.     document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
  7. }
  8.  
  9. function getCookie(cname) {
  10.     var name = cname + "=";
  11.     var decodedCookie = decodeURIComponent(document.cookie);
  12.     var ca = decodedCookie.split(';');
  13.     for(var i = 0; i <ca.length; i++) {
  14.         var c = ca[i];
  15.         while (c.charAt(0) == ' ') {
  16.             c = c.substring(1);
  17.         }
  18.         if (c.indexOf(name) == 0) {
  19.             return c.substring(name.length, c.length);
  20.         }
  21.     }
  22.     return "";
  23. }
  24. ****/
  25.  
  26.  
  27. function usuarioPodeResponder() {
  28.     var pesquisa = getCookie('pesquisaPN');
  29.     if(!pesquisa) {
  30.         var cookie = setCookie('pesquisaPN', true, 100);
  31.         window.location.href = "https://git.ng.bluemix.net/equipe-bia/pesquisa-pn.git";
  32.     }
  33. }
  34.  
  35. //No link colocar - onclick="usuarioPodeResponder();"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement