Spiessens Edwin wrote:Cindy Schmelzenbach wrote:
Calling in Menu from external javascript
if you have the same menu on several different pages, you can call it in from an external javascript file. Just copy the code, paste it into a new document, delete all of the code above
function Go(){return}
and below
function AfterCloseAll(){return}
then save that as menu.js (or whatever name), and place this code in your page:
<script type="text/javascript" src="menu.js"></script>
... then, I put that inside a span.
You don't have to re-copy all the code into each page!
Hi Cindy (or anyone else who can help me with this) :
I was looking for a solution to have my menu on different pages so calling it from an external file was obvious. However, I can not find the code phrases you refer to (function Go(){return} and function AfterCloseAll(){return} ) in the code of my script.
Am i missing something here?
Hope you can help me
Cheers,
Edwin
This post was moved from the Tips & Tricks section.
The two code bits you are looking for are right at the start and at the end of the menu code.
Ha en riktig god dag!
Inger, Norway
http://www.eikweb.com
http://www.horgenhonning.net/
http://www.norwayroots.com
http://www.johnsflats.com
Its actually easier and lighter for your page weight to just use a server side include. See:
http://www.innovatewebdevelopment.com/support.html
This will demonstrate how to do this.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.
My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).
My Personal Website: http://www.EricSEnglish.com
Hi Eric,
Thanks for the reply first of all!
Ok, this is partly working: see
http://www.horsesafari.co.za/about_us_test.shtml (as a matter a fact, it works more or less the same way as with the javascript)
I have placed the SSI call in the table but it seems to have no effect on the placing of the menu
The menu should appear between the logo and the picture with the wildebeest
Any idea how to tackle this ?
Txs anyway!
Edwin
Cheers
Edwin
Could you paste that portion of the code so I can review it? Also what type of server is your site on?
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.
My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).
My Personal Website: http://www.EricSEnglish.com
Edwin,
There seem to be a few general problems with the HTML code on the page you gave a link to:
1. There is no doctype declaration.
2. There are multiple sets of <head></head> and <body></body> sections for the same page
I think you need to clean up some of these problems first, since they could lead to unpredictable behavior here and there and would make any debugging of specific issues very difficult.
Per
www.mingas.com
There you go that would be the problem. If you have the html editor you can use code clean to clean it up for you.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.
My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).
My Personal Website: http://www.EricSEnglish.com
There is also quite a bit of code AFTER a </html> tag. There is another </html> tag, but as Connor MacLeod (of the Clan MacLeod) says "There can be only one!"
"Time heals everything. Know who said that? My Latin teacher at barber college!"
- Floyd Lawson
Widoktadwat - "Plays Well With Others"
Per wrote:
Edwin,
There seem to be a few general problems with the HTML code on the page you gave a link to:
1. There is no doctype declaration.
2. There are multiple sets of <head></head> and <body></body> sections for the same page
I think you need to clean up some of these problems first, since they could lead to unpredictable behavior here and there and would make any debugging of specific issues very difficult.
Hi All!
I think the HTML problem with the header and body tags is solved now: it were actually the header and body tags of the SSI page.
I removed them from that page and now i think this is fixed.
About the doctype, this code is created with frontpage and it does not generate a doctype
What exactly should i write for this?
The positioning however is still the same.
This is the code of my "about_us_test.shtml" page:
<td width="765">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="765" height="26">
<tr>
<td>
<!--#include file="ssi_menu.htm" -->
</td>
</tr>
</table>
</td>
Hope you can help me here cause i am far from a hero when it comes to HTML
Txs!
Edwin
Just a brief glance, but it looks as if the table containing the menu should be placed underneath the table containing your logo image and just before the wildebeest image.
So try changing places between this code:
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="765" height="261">
<tr>
<td>
<img border="0" src="images/about_us_main.jpg" width="765" height="261"></td>
</tr>
</table>
and the table of code containing the script for the menu which is higher up the page.
Not certain if it will work, but it's worth a try.
http://www.venicefromtheinside.com
Edwin,
Create a <span id="something"> </span> where you want the menu to appear. And between those span tags you put the entire menu script, or just the ssi call for it.
Further, you have to locate this line in the menu script:
/***********************************************************************
DO NOT EDIT ANYTHING BELOW THIS LINE - IT WILL BREAK THE SCRIPT !
***********************************************************************/
About 8-9 lines above that you'll find the line
var TargetLoc=''; // span id for relative positioning
Between the '' write the id name you gave the span tag. That should fix the positioning.
Ha en riktig god dag!
Inger, Norway
http://www.eikweb.com
http://www.horgenhonning.net/
http://www.norwayroots.com
http://www.johnsflats.com