Can I have behaviors in an included file in Frontpage 2003?

S

Steve Graham

I have a fairly simple include file that I use to display a standard
menu on each page of my website. The include file just has a one row
table with a different graphic in each cell, each cell is a menu
option and hyperling to a different page.

I have associated a swap image behavior to each graphic so that the
image changes when the user Mouses Over it.

I include the page in my main web page and it works fine when I
preview it in Frontpage, but, when I upload it to my Frontpage enabled
web server, as soon as I mouse over the graphic I get a Runtime Error,
Error: Object Expected.

What I think is happening is that the code to handle the image swaps
is being generated in the file I am including. When I include it in my
main page, the code is being included half way down the page in
amongst all of the standard HTML formatting tags so when I mouse over
the graphic and it looks for the swap image function it can't find it
in the right place at the top of the document and hence the Error:
Object Expected message.

Am I right? More importantly, can I use behaviors in an include file
and if so how?

Thanks

Steve
 
T

Thomas A. Rowe

Not possible when FP is writing the JavaScript code. You would need to use a 3rd Party JavaScript
mouse over script that can either be placed in the head section of each page using the include or
between the body tags of the include page or a external .js file which is link to all pages using
the include.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

Consider using the Dynamic Web Template.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
R

Ronx

If you are using FrontPage 2003 swap image behaviour then Yes, you can use
the Swap Image behaviour in include pages, with limitations. The
JavaScript in the <head> section will be correctly generated in all pages
using the include, but the image paths used in the onmouseover and
onmouseout events may not be correct. See
www.rxs-enterprises.com/fp/b/buttons/ which demonstrates some of the
problems involved using Interactive Buttons - some of these problems are
also relevant to the Swap Image behaviour.

In testing, I could not replicate your "object expected" problem, and all
image paths were correctly written by FP (which does not always happen with
Interactive Buttons).
 
A

Andrew Murray

I've done a similar thing.....I have a page called 'heading.htm' which is the
page banner/title/menu, including rollover images (using the rollover/image swap
feature in FP 2002).

I use the shared top border, into which I put the included content (page) i.e.
the included page heading.htm inside _borders/top.htm (if that makes sense) and
the rollover images work fine. You could try this....

Otherwise I don't know.
 
A

Alec Usticke

If you are using FrontPage 2003 swap image behaviour then Yes, you can use
the Swap Image behaviour in include pages, with limitations. The
JavaScript in the <head> section will be correctly generated in all pages
using the include, but the image paths used in the onmouseover and
onmouseout events may not be correct. See
www.rxs-enterprises.com/fp/b/buttons/ which demonstrates some of the
problems involved using Interactive Buttons - some of these problems are
also relevant to the Swap Image behaviour.

I got around this problem by going into Code and replacing all /*url*/
links with direct ones, e.g., I changed /*url*/'button18.jpg' to
'http:/www.usticke.org/menu/button18.jpg'. It seems to work fine; it
works from the root and all directories.

Besides the issue of maintenance -- I'll need to update the Code each
time I make changes -- do you see any potential problems with this
workaround?
 
R

Ronx

That workaround should not pose any problems, apart from (as you said)
maintenance. You could shorten the URL to '/menu/button18.jpg' (note the
slash before menu).
Ron
 
A

Alec Usticke

Thanks. That web page had me scared that there wasn't a practical
solution, but this works like a charm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top