0
function display()
{
    var menu_frame_filtered = top.menu_frame.filtered;
//filtered array taken from menu frame
    var displayed = menu_frame_filtered;
// giving filtered array new name
    var p = displayed.length;
//  window.open('Part_database/' + displayed[0] + '.jpg')
//displayed array contains image names and checked whether they are opening
//  
     document.write('<table border="0" cellspacing="0" cellpadding="0">')
    document.write('<tr>')
    for(i = 0; i < p; i++)
    {
    document.write('<td>' + displayed[i] + '</td>')
//image names in first cell
    }
    document.write('</tr>')
    document.write('<tr>')
    for(i = 0; i < p; i++)
    {
    document.write('<td width="250" ><img src="Part_database/ '+ displayed[i] +' .JPG" alt=' + displayed[i] + ' width="200" height="200" /></td>')
//images in second cell
    }
    document.write('</tr>')
    document.write('</table>')
}

上面的代码没有在表格中显示图像......试图找出挑战。浏览器 - IE8。提前致谢。

4

1 回答 1

2

您有一个可能不属于的额外空间:

document.write('<td width="250" ><img src="Part_database/ '+ displayed[i] +' .JPG" alt=' + displayed[i] + ' width="200" height="200" /></td>')
                                                         ^                  ^
                                                         ^                  ^
                                                         ^                  ^
于 2013-03-06T08:57:48.160 回答