Forum Moderators: open

Message Too Old, No Replies

A Toolbar with html AND javascript

quick question

         

Ryan Holiday

1:55 am on Sep 8, 2005 (gmt 0)

10+ Year Member



I have a website in which the left and right hand toolbars are both projected on regular html pages via the citation of a js page. I would also like Google Adsense ads to appear below each toolbar which unfortunatly is not possible to do with js.

So I have set up a SSI page that sites the Google code. All I need to know now, is where to place the <!--#include file="adsense.html" -->

so it appears in the correct spot.

The JS toolbar looks like this:

document.write('<tr>')
document.write('<td valign="top">')
document.write('<div style="width: 160;">')
document.write('<div class="nav_link"><a href="index.html">Home</a></div>')
document.write('<div class="nav_link"><a href="blogger.html">Blog</a></div>')
document.write('<div class="nav_link"><a href="columns.html">Columns</a></div>')
document.write('<div class="nav_link"><a href="published.html">Published Works</a></div>')
document.write('<div class="nav_link"><a href="books.html">Book Reviews & Quotations</a></div>')
document.write('<div class="nav_link"><a href="topten.html">Top Tens</a></div>')
document.write('<div class="nav_link"><a href="pop.html">Pop Culture</a></div>')
document.write('<div class="nav_link"><a href="misc.html">Misc</a></div>')
document.write('<div class="nav_link"><a href="aboutme.html">About Me</a></div>')
document.write('<div class="nav_link"><a href="faq.html">F.A.Q</a></div>')
document.write('<div class="nav_link"><a href="contact.html">Contact</a></div>')
document.write('</div>')
document.write('</td>')

document.write('<td id="main" valign="top" width="100%">')

And then each HTML page cites that bar like this:

<script language="javascript" type="text/javascript">javascript:header();</script>

How can I make it so the SSI placement of the Ad code appears directly under the "Contact" link?

Thanks so much

encyclo

6:16 pm on Sep 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Firstly, sorry it to so long to get a reply, Ryan.

If you are looking to use the server-side include within the Javascript file, then it can't be done. In fact there is a fundamental weakness with your current setup, in that your entire menu is dependent on Javascript, making it "unspiderable" as no search engine spiders can read external Javascript files.

Your best solution is to bite the bullet and replace the Javascript call on each page with an SSI or (even better) a PHP include, then have your menu markup (as plain HTML, not written out in JS) as well as your AdSense code within the file called by that include. There are a number of tools which can do a global search/replace across many files, so even if you have a lot of pages the change won't be to difficult.

You should avoid changing the file names if possible even if you are using server-side includes. Dependent on the type of server you are using, you can let files ending in .html be parsed for SSI.

MatthewHSE

9:05 pm on Sep 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dependent on the type of server you are using, you can let files ending in .html be parsed for SSI.

Or PHP, but not both. (Encyclo is right - use PHP includes if possible.)

Ryan Holiday

6:29 am on Sep 15, 2005 (gmt 0)

10+ Year Member



Thank you for the response. Ultimately, I ended up having to do all that. It took forever, but I think I am better for it. Thanks for all the help