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 に答える