39
| <![CDATA[<script>
jQuery(window).load(function($){
atualizaRelogio();
});
</script>]]>
|
496
| <![CDATA[<script>
$(function() {
$('#q').clear();
$('#q').focus();
});
</script>]]>
|
513
| <![CDATA[<script>
function showTimer() {
var time=new Date();
var hour=time.getHours();
var minute=time.getMinutes();
var second=time.getSeconds();
if(hour<10) hour ="0"+hour;
if(minute<10) minute="0"+minute;
if(second<10) second="0"+second;
var st=hour+":"+minute+":"+second;
document.getElementById("timer").innerHTML=st;
}
function initTimer() {
// O metodo nativo setInterval executa uma determinada funcao em um determinado tempo
setInterval(showTimer,1000);
}
</script>]]>
|
530
| <![CDATA[<script>
$(function() {
$("#btn-search").click(function() {
$(".error").hide();
var hasError = false;
var searchReg = /^[a-zA-Z0-9-]+$/;
var searchVal = $("#q").val();
var theLength = $("#q").val().length;
if (searchVal == '' || theLength < 3 ) {
document.querySelector('#q').value = "";
document.querySelector('#q').placeholder = "minimo 3 caracteres";
hasError = true;
} else if (!searchReg.test(searchVal)) {
document.querySelector('#q').value = "";
document.querySelector('#q').placeholder = "caracteres inválidos";
hasError = true;
}
if (hasError == true) {
return false;
}
});
});
</script>]]>
|