Error: Component is not available
Line: 42
window.onload = function(){
window.onload = function(){
for (var i = 0; i <= planet.length; i++) {
planet_id[i] = ....
}
}
Тоже самое...
Вот весь код:
var url = location.href;
var nickname = document.getElementById('playerName').getElementsByClassName(
'textBeefy')[0].innerHTML;
var server = url.split('/')[2];
var uni_name = document.getElementsByTagName('title')[0].innerHTML;
var address = url.split('/')[4];
var page = address.match(/page=([^&]+)/);
var session = address.match(/session=(.+)$/);
var planet = document.getElementById('rechts').getElementsByClassName('smallplanet');
var planet_id = new Array();
var planet_pics = new Array();
var planet_name = new Array();
var planet_coords = document.getElementsByClassName('planet-koords')[0].innerHTML;
var moon_id = new Array();
var moon_pics = new Array();
var moon_name = new Array();
var moon_coords = new Array();
var planet_count = 0;
var moon_count = 0;
var planet_number = 0;
var moon_number = 0;
window.onload = function(){
get_vars();
}
function get_vars () {
for (var i = 0; i <= planet.length; i++) {
planet_id[i] = planet[i].innerHTML.split('moonlink')[0].slice(planet[i].innerHTML.split('moonlink')[0].indexOf('&cp=')+8, planet[i].innerHTML.split('moonlink')[0].indexOf('" title'));
planet_pics[i] = planet[i].getElementsByClassName('planetlink')[0].getElementsByClassName('planetPic')[0].src;
planet_name[i] = planet[i].getElementsByClassName('planetlink')[0].getElementsByClassName('planet-name')[0].innerHTML;
planet_coords[i] = planet[i].getElementsByClassName('planetlink')[0].getElementsByClassName('planet-koords')[0].innerHTML;
if (planet[i].innerHTML.indexOf('src="img/planets/moon/') > 0) {
moon_id[i] = planet[i].innerHTML.split('moonlink')[1].slice(planet[i].innerHTML.split('moonlink')[1].indexOf('&cp=')+8, planet[i].innerHTML.split('moonlink')[1].indexOf('" title'));
}
}
}
Всё что идёт до функции без проблем парситься и выводиться через те-же alert'ы...
Но сама функция не хочет...
GreaseMonkey, Firefox/3.6.6