ŖЌǾ
Full Member
Posts: 227
|
Post by ŖЌǾ on Nov 24, 2007 11:40:37 GMT -5
Well I finished my head/base code. Info about this code: Allows u to add head/base images for your forum It will only appear on the main page Place this code in: Main FooterI've tested this code on all 3 browsers: FF, IE, Opera. Worked perfectly. Here's the code: <script type="text/javascript"> <!-- // Adds head/base images for main page. //Coded by Roger aka RKO. //Helped by Reverseblade. //Do not RIP nor Repost.
var headimage = 'HEAD URL'; // Main head. var baseimage = 'BASE URL'; // Main base.
var h = '<img src="'+headimage+'" />'; var b = '<img src="'+baseimage+'" />';
var roger=document.getElementsByTagName('table'); for(i=0;i<roger.length;i++){ if(roger[i].cellSpacing=='0' && roger[i].className=='bordercolor' && roger[i].innerHTML.match('Forum Name')){ var r1 = roger[i].insertRow(0).insertCell(0); var r2 = roger[i].insertRow(2).insertCell(0); r1.innerHTML= h r2.innerHTML= b; } }
//--> </script>
Wana thank Reverblase for helping me through this code
|
|
|
Post by Schubaltz on Nov 24, 2007 12:16:00 GMT -5
Looks good.
If you could, though, fix the border problem. Maybe remove the class from the table you're grabbing and add it to the table just inside it? And a location check isn't essential, but it could cut a few milliseconds off the coding (which helps for forums that like to add a hundred codes to the main footer). My only other suggestion is looking up the break operator. It's used to halt execution in loop statements.
for(var i = 0; i < 10; i ++) { if(i == 5) { break; // stop loop when i is 5 } }
Handy when you no longer need the code to run.
|
|