Здравейте тия дни заради AJAX и един пич научих малко js и стигнах до тук
но не знам каде ми е грешката
моля ви помогнете ми
явно при if(tipfail ...) моля ви хелп
но не знам каде ми е грешката
Код:
<script>
function counter(nz){
var dokumenta = document.send.link.value;
var array = dokumenta.split("http://");
var count = array.length-1;
var lastcount = 0;
for(var i = 0; i < count; i ++){
var tipfail = array[i].split(".");
if((tipfail != "rar") && (tipfail != "zip") && (tipfail != "mp3") && (tipfail != "iso") && (tipfail != "jpg") && (tipfail != "tr") && (tipfail != "mov") && (tipfail != "jpg") && (tipfail != "wmv") && (tipfail != "ace") && (tipfail != "ico") && (tipfail != "jpeg") && (tipfail != "avi") && (tipfail != "3gp") && (tipfail != "mp4") && (tipfail != "cue") && (tipfail != "srt") && (tipfail != "txt") && (tipfail != "bin") && (tipfail != "gif") && (tipfail != "sub") && (tipfail != "bmp") && (tipfail != "mpg") && (tipfail != "bat") && (tipfail != "img") && (tipfail != "wma") && (tipfail != "ac3") && (tipfail != "wav") && (tipfail != "tar") && (tipfail != "mpeg") && (tipfail != "png") && (tipfail != "com") && (tipfail != "exe") && (tipfail != "tiff") && (tipfail != "pdf") && (tipfail != "sql") && (tipfail != "html") && (tipfail != "JPG") && (tipfail != "doc") && (tipfail != "htm") && (tipfail != "xls"))
{ } else{
lastcount += 1;
}
}
alert(lastcount);
document.send.counts.value=count;
}
</script>