Hey guys!
I need a second pair of eyes here.
This loop was running fine, then I stopped it and started it again and now I am getting a syntax error on the line where it sets the marker.
[code=php]
<script type=”text/javascript”>
var topics = new Array(“Arts”, “Business”, “Computer”, “Education”, “Entertainment”, “Health”, “News”, “Recreation”, “Science”, “Society”);
var links = new Array();
var found = false;
for(i=0; i < topics.length; i++){
var this_topic = topics[0];
for(j=0; j < document.links.length; j++){
var node = document.links[j];
if(node.firstChild.nodeValue == null)continue;
var marker = node.getAttribute(‘href’).lastIndexOf(‘/’, 0);
if(node.getAttribute(‘href’).substr(marker+1, this_topic.length)) == this_topic){
if(!found){
found = true;
node.setAttribute(‘class’, ‘parent’);
}else{
node.setAttribute(‘class’, ‘child’);
}
}
}
topics.shift();
found = false;
}
</script>
Thx!
[b]RESOLVED
if(node.getAttribute(‘href’).substr(marker+1, this_topic.length)[COLOR=Red])
1 too many