Forum Moderators: open

Message Too Old, No Replies

Frontpage Includes Page Issue

         

PIMullet

12:44 pm on Sep 11, 2003 (gmt 0)



Hi all, I thank you in advance if anyone can help.

I am creating a site that I must use includes pages (frontpage). My problem is that when I include the navigational structure, it will not show the rollovers. When I look at the page by itself (the navigation) everything looks fine but when it's an included element, things aren't so fine.

<snip>

Any help would be very appreciated, this has me pulling out my hair! Thanks!

[edited by: korkus2000 at 6:32 pm (utc) on Sep. 11, 2003]
[edit reason] No code reviews please or URLs [/edit]

korkus2000

6:36 pm on Sep 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the board PIMullet,

I would first ask if your include file has html and body tags like a normal page. If so then your problem is you are probably firing javascript elements in a second onload event handler in a second body tag. If you include files that are full html pages it confuses the browser to make intermittent and strange problems. Includes should look like sections of HTML content that merge into the page including them. Javascripts and event handlers should be added to the main page in its head and body.

jimbeetle

6:57 pm on Sep 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WW PIMullet,

Actually, the body tags in the included page should not be a problem as the FP include page function should only include the content between the body tags and nothing else.

So, a couple of things to look at. If part of the js rollover script is included in the head of the included page it probably won't be included in the main page. Might be best to call this as an external js on each page it is going to be used.

Another problem might be relative URLs referenced in the js of the included page. FP appears to handle rewriting straight html relative URLs when including a page pretty well, but if the directory structure is different it often has problems rewriting URLs embedded in js. So, if your structure is something like...

yourdomain.com/contents/data/includepage.htm

which is included in:

yourdomain.com/mainpage.htm

...when includepage is saved into mainpage the relative URLs are not rewritten and wind up pointing to the wrong directories.

A simple way to check anything with FP and the include page function is to do a view source and see what the html looks like. I've had many surprises and often have found that using full references is the only way to solve this problem.