Hi, I got javascript error: unknown exception in IE 6

Take a look:

http://buildalook.com/index.php?l=Measure
login: test2
password: test2

Click "other information" in the left, first it's work good. But when I refresh and click "other information" again, I got javascript error: unknown exception.

Can you help me?

Excluding the use of bugFixing tools-- you can simply remove all <script></script> blocks inside your page and bring them back one by one, test the page then refresh your browser.

If you find the block, simply post it back here again for help...

You have used so many tables in your HTML. I can only suggest you to re-check your HTML code. May be some <td> <tr> </td> </tr> tags are missing.

Here is the error in line 242

eval(begining+"setHtml('"+response[response.length-1]+"out','"+html+"');"+end);

This is only happened in IE 6, in firefox no error.

<<<network problem>>>

Can you provide direct URL for the script/.js, containing this line?

Yes, take a look the attachment

Hi gakki,

Sorry, but I am unable to access (or download) your file' via WAP connect, that's why i am asking for direct path in your domain so i could just view the whole block from there.

This is the only source i get VIEW SOURCE still aint gettin those lines.

- My computer went down, so i am just using a palm device to answer thread's visibly posted here.

Don't worry i'm sure someone here will provide you extra help asside from me...

Try to fix this line:

Old lines:

if(response[i][3]!='Select' && response [i][3]!='No Img') end='};image'+i+'.src = "DB/measure/'+response[i][0]+'.jpg";'+end;

Convert the Old lines into this format:

if ( response[ i ][ 3 ] !== 'Select' && response[ i ][ 3 ] !== 'No Img' ) 
end= '};'
begining += 'image' + i + '.src = "DB/measure/' + response[ i ][ 0 ] + '.jpg";' + end;

Run some test and let me know how it worked.

Okay I will test it later

Essential, I got error in firefox when I implemented your solution.

Error: syntax error
Source File: http://buildalook.com/index.php?p=index.php&l=Measure#
Line: 247, Column: 7
Source Code:
ble>');};

Line: 247

eval(begining+"setHtml('"+response[response.length-1]+"out','"+html+"');"+end);

Do you know why?

This the openTop() function reference, and i've fixed some of the lines.

The only problem is i don't know where stop on each of these statement inside the function having it done on a small screen.

Just un-comment the part where it needs to be executed.

function() {  
   response = req.responseText.split("~");
   html = "<table>";
   begining = "";
   end = "";
   inside = ""; 
      for ( k = 0; k < ( response.length - 1 ); k++ ) { 
// replace the i incrementor with k, since you are using it as an arguments in other function.
      response[ k ] = response[ k ].split("`");

      inside += response[ k ][ 0 ];
      } // window.storage = response;
      for ( k = 0; k < ( response.length - 1 ); k++ ) {
         /* if (( response[ k ][ 3 ] !== "Select" ) && ( response[ k ][ 3 ] !== "No Img" )) { */
         begining += "var image" + k + " = new Image();";
         begining += "image" + k + ".onload = function() {";
         /* } */
         /* if (( response[ k ][ 3 ] !== "Select" ) && ( response[ k ][ 3 ] !== "No Img" )) { */
         end = "}; image" + k + ".src = \"DB/measure/" + response[ k ][ 0 ] + ".jpg\"" + end;
         /* } */
html += "<tr>\n";
      html += "<td style=\"text-align : left\" onmouseover=\"openInside( '" + response[ k ][ 0 ] + "', ";
         /* if (( response[ k ][ 3 ] !== "Select" ) && ( response[ k ][ 3 ] !== "No Img" )) { */
         html += "'DB/measure/" + response[ k ][ 0 ] + ".jpg'";
         /* } else { */
         html += "''";
         /* } */
         html += ", '" + inside + "' )\"><img src=\"";
         /* if( response[ k ][ 4 ] === "" ) { */ 
         html += "/images/measurements/dash.jpg";
         /* } else { */
         html += "/images/measurements/check.jpg";
         /* } */ 
         html += "\" id=\"" + response[ k ][ 0 ] + "img\"></td>\n<td style=\"text-align : left;\" onmouseover=\"openInside( '" + response[ k ][ 0 ] + "', ";
         /* if (( response[ k ][ 3 ] !== "Select" ) && ( response[ k ][ 3 ] !== "No Img" )) { */
         html += "'DB/measure/" + response[ k ][ 0 ] + ".jpg'";
         /* } else { */
         html += "''";
         /* } */
      html += ", '" + inside + "' );\">" + response[ k ][ 1 ] + "</td></tr>\n";
         /* if( response[ k ][ 3 ] === "Select" ) */
         html += "<tr id=\"" + response[ k ][ 0 ] + "hide1\"  style=\"display : none;\"><td>&nbsp;</td><td style=\"text-align : left; width : 100%;\"><table id=\"" + response[ k ][ 0 ] + "sl\" style=\"cursor : pointer; background-color : white; color : black; width:100%;\" cellspacing=\"0px\">\n";
         items = response[ k ][ 5 ].split("}"); 
         for ( j = 0; j < ( items.length - 1 ); j++ ) {
         items[ j ] = items[ j ].split("{"); 
         html += "<tr><td id=\"" + response[ k ][ 0 ] + "" + items[ j ][ 0 ] + "opt\" ";
            /* if ( response[ i ][ 4 ] === items[ j ][ 0 ] ) { */
            html += "style=\"background-color:blue;color : white;\"";
            /* } */ 
         html += "onclick=\"selectOption( '" + response[ k ][ 0 ] + "', '" + items[ j ][ 0 ] + "');\" onmouseover=\"changeOption( '" + response[ k ][ 0 ] + "', '" + items[ j ][ 0 ] + "'";
            /* if ( items[ j ][2] === 0 ) { */ 
            html += ",false";
            /* } */
            html += ");\">" + items[ j ][ 1 ] + "</td><tr>";
            /* if ( items[ j ][ 2 ] === 1 ) { */ 
            begining += "var image" + k + "o" + j + " = new Image(); image" + k + "o" + j + ".onload = function() {";
             /* if ( items[ j ][ 2 ] === 1 ) { */
              end = "}; image" + k + "o" + j + ".src = \"DB/measure/select/" + items[ j ][ 0 ] + ".jpg\";" + end;
            /* } */
           html += "</table></td></tr>";
          /* } else { // Confusing part: Try to base this block in your code and see which part of line  should take the end bracket. */
          html += "<tr id=\"" +response[ k ][ 0 ] + "hide1\" style=\"display : none\"><td>&nbsp;</td><td style=\"text-align:left\"><input type=\"text\" maxlength=\"3\" style=\"width:25px\" onkeyup=\"measchange(" + response[ k ][ 0 ] + ", this.value );\" value=\"" +response[ k ][ 4 ] + "\">"  + response[ k ][ 2 ] + "</td></tr>";
            if ( response[ k ][ 3 ] === "Rack" ) { 
            html += "<tr id=\"" + response[ k ][ 0 ] + "hide2\" style=\"display:none\"><td>&nbsp;</td><td style=\"text-align:right\">Optional: off the rack size: <input type=\"text\" maxlength=\"3\" style=\"width:25px\" onkeyup=\"rackchange(" +response[ k ][ 0 ] + ", this.value );\" value=\"" + response[ k ][ 5 ] + "\"></td></tr>";
            } else {
            html += "<tr id=\"" + response[ k ][ 0 ] + "hide2\" style=\"display:none\"></tr>";
            }
      /* } */        
      } /* END BLOCK: For statement with j incrementor */
   } /* END BLOCK: For statement with k incrementor */
      html += "</table>";
      eval( begining + "setHtml('" + response [response.length-1] + "out', '" + html + "' );" + end );
 
}; /* EXIT Function */
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.