Declare a
outside of the loop and define it as an empty string, then append results to it as you go:
navigator.plugins.refresh(false);
var numPlugins = navigator.plugins.length;
var a = '';
for (var i = 0; i < numPlugins; i++){
var plugin = navigator.plugins[i];
if (plugin) {
a += plugin.name + plugin.description + plugin.filename;
}
}
You may want to use an array of strings though, since you could have many plugins:
navigator.plugins.refresh(false);
var numPlugins = navigator.plugins.length;
var a = [];
for (var i = 0; i < numPlugins; i++){
var plugin = navigator.plugins[i];
if (plugin) {
a.push(plugin.name + plugin.description + plugin.filename);
}
}
EDIT If you need to hash a
into something:
var hash = yourMd5Function(a);
Or for the second example:
var b = a.join(','); // "plugin1,plugin2,..." for example
var hash = yourMd5Function(b);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…