Nightwalker
Full Member
Everything Happens at Night
Posts: 138
Nightwalker said 0 great things
|
Post by Nightwalker on Jun 19, 2010 9:29:39 GMT -8
yea we still do that...it was hot and fun...
ok now back to that last post. I can sort of read it but if i was to give that to someone they wouldn't know were to put the affiliates...i can prob figure that one out. but why is it that every line starts with nwTbl+=
|
|
|
Post by Wormopolis on Jun 19, 2010 13:38:11 GMT -8
the += operator in javascript means to append. its a shorter way of saying: a=a+b;
shorter: a+=b;
|
|
Nightwalker
Full Member
Everything Happens at Night
Posts: 138
Nightwalker said 0 great things
|
Post by Nightwalker on Jun 19, 2010 16:07:51 GMT -8
so what did writing like that do?
|
|
|
Post by Wormopolis on Jun 19, 2010 17:45:58 GMT -8
maybe you arent understanding the point of that.
you cant just leave all the multilines in the middle of that variable or you are going to get an "unterminated string" error in javascript.
so lets outline what your code should do.
|
|
Nightwalker
Full Member
Everything Happens at Night
Posts: 138
Nightwalker said 0 great things
|
Post by Nightwalker on Jun 20, 2010 9:11:27 GMT -8
i deff am not understanding...
|
|
Nightwalker
Full Member
Everything Happens at Night
Posts: 138
Nightwalker said 0 great things
|
Post by Nightwalker on Jun 22, 2010 5:54:20 GMT -8
ok now that i look at it more i seen to be understanding a little better
so if i took this
<script> var nwTbl='<table width="92%" align="center"><tr><td width="200px" valign="top" style="padding-top: 40px;"><table width="200px" cellpadding="4px" class="bordercolor" cellspacing="1"><tr><td align="center" class="titlebg" valign="top" >Affiliates</td></tr><tr><td class="windowbg"><center><img src="put url of your mini banner here" width="88" height="31" alt="" title="Copy Affiliate Code" onclick='affcode("put url of your mini banner here");'; style="cursor:pointer;"/>click banner to get affiliate code<marquee onmouseover="this.stop()" onmouseout="this.start()" direction="up" scrollamount="3"><center><a href="website url" target="_blank"><img src="mini banner" height="31" width="88" border="0" alt="name" /></a><a href="website url" target="_blank"><img src="mini banner" height="31" width="88" border="0" alt="name" /></a></marquee></center></td></tr></table></td><td width="100%">'; if (document.getElementById('linktable')) document.getElementById('linktable').innerHTML= nwtbl; </script>
and put it in my global headers then what would i do next?
|
|
|
Post by Wormopolis on Jun 23, 2010 19:18:30 GMT -8
then anywhere that that code finds an element on the page with id=linktable, it will insert what is in nwtbl into it. you could put that code into global footers, and any page you want the table to show, actually make the element for it to receive and it will. if you only wanted a certain board to have th etable, just put that element into THAT board header, or if only on the main page, then in the main header. you could even put that element into a side bar, as long as the element occurs BEFORE the script tries to run, it will be able to find it.
now if you wanted that table to show ina certain board, but ONLY when viewing a certain thread, you would have to get clever and use a little more JS to do a document write:
<script type="text/javascript"> if (location.href.match(/thread=1234($|&)/)) document.write("<div id='linktable'></div>"); </script>
the stuff after the number is important to keep from matching partial numbers (like 10 and 105 would match if you just left it at thread=10).
|
|
Nightwalker
Full Member
Everything Happens at Night
Posts: 138
Nightwalker said 0 great things
|
Post by Nightwalker on Jun 24, 2010 18:50:42 GMT -8
now if i wanted that to display on the rite of the forum what would i do?
|
|
|
Post by Wormopolis on Jun 24, 2010 19:39:00 GMT -8
make the div that receives it have align="right" as an attribute
|
|