I am currently taking over working on our corporate intranet from an employee that has left our company. We have a page that allows us to manipulate files (move, delete, download) based on action selected. However when the index.php page loads I am receiving a javascript error that I cannot pinpoint the problem.
The line error is highlighted in [red]red[/red] below:
------------------------------------------------------------------------------
nobody knows everything about IT, so make a point to help your fellow members
-= j@ckle =-
The line error is highlighted in [red]red[/red] below:
Code:
<script language="javascript" src="include/progress.js"></script>
<script language='JavaScript'>
var farr = new Array();
var darr = new Array();
var dest = '';
function fchecked(){
var numfiles = document.forms['checkedfiles'].elements.length-1; var i;
var c=0;
for(i=0;i<numfiles;i++){
if(document.forms['checkedfiles'].elements[i].checked){
var val = document.forms['checkedfiles'].elements[i].value;
var val2 = document.forms['checkedfiles'].elements[i].id;
farr[c]=val;
darr[c]=val2;
c++;
}
}
}
function picked(sel){
var choice = sel.selectedIndex;
dest = sel.options[choice].value;
}
var c=0;
var actfailed = 0;
function perform(act){
fchecked();
if(farr.length !== 0) {
progressBarInit();
var i;
for(i=0;i<farr.length;i++){
if(act == 'movefile'){
if(dest !== ''){
actfailed = 0;
urlString = 'index.php?action='+act+'&filename='+farr[i]+'&directory='+darr[i]+'&new_dir='+dest+'&';
processAct(urlString);
} else {
actfailed = 1;
alert('please pick a target');
break;
}
} else {
actfailed = 0;
urlString = 'index.php?action='+act+'&filename='+farr[i]+'&directory='+darr[i]+'&';
processAct(urlString);
}
}
if(actfailed !== 1) window.status = 'Please wait...';
} else {
alert('You need to select a file in order to perform an action. Note: If you are in a top-level directory then click on a directory that contains files.');
}
}
function processAct(url){
document.getElementById('popContainer').innerHTML += '<iframe width=\'200\' height=\'200\' src=\''+ url +'\'></iframe>';
}
function refreshPage(rdir){
window.location = 'index.php?&none&directory='+rdir+'&';
}
function notify(){
var delay = '1000';
c++;
if(c == farr.length) window.setTimeout("refreshPage('"+darr[0]+"')", delay);
}
[red][b]window.onload = window.parent.notify();[/b][/red]
</script>
------------------------------------------------------------------------------
nobody knows everything about IT, so make a point to help your fellow members
-= j@ckle =-