これに沿って何かをすることが可能かどうか疑問に思います:
var label = new Array();
label[0] = "label0";
label[1] = "label1";
var value = new Array();
value[0] = "value0";
value[1] = "value1";
for (i=0,i<label.length,i++)
{
document.write( label[i] + " = " + value[i] );
}
ラベル配列は明らかに値配列用であり、常に同じサイズになります。これを行う適切な方法があれば?
編集:これが本当の取引です
var documents = new Array();
documents[0] = navigator.appCodeName;
documents[1] = navigator.appMinorVersion;
documents[2] = navigator.appName;
documents[3] = navigator.appVersion;
documents[4] = navigator.browserLanguage;
documents[5] = navigator.buildID;
documents[6] = navigator.cookieEnabled;
documents[7] = navigator.cpuClass;
documents[8] = navigator.language;
documents[9] = navigator.mimeTypes;
documents[10] = navigator.onLine;
documents[11] = navigator.oscpu;
documents[12] = navigator.platform;
documents[13] = navigator.plugins;
documents[14] = navigator.productSub;
documents[15] = navigator.userLanguage;
documents[16] = navigator.userProfile;
documents[17] = navigator.vendor;
documents[18] = navigator.vendorSub;
var label = new Array();
label[0] = "appCodeName";
label[1] = "appMinorVersion";
label[2] = "appName";
label[3] = "appVersion";
label[4] = "browserLanguage";
label[5] = "buildID";
label[6] = "cookieEnabled";
label[7] = "cpuClass";
label[8] = "language";
label[9] = "mimeTypes";
label[10] = "onLine";
label[11] = "oscpu";
label[12] = "platform";
label[13] = "plugins";
label[14] = "productSub";
label[15] = "userLanguage";
label[16] = "userProfile";
label[17] = "vendor";
label[18] = "vendorSub";
for(var i=0;i<documents.length;i++)
{
document.write( label[i] + " = " documents[i] + "<br >" );
}
エラーは次のとおりです。UncaughtSyntaxError:予期しない識別子print.htm:56