javascript function in js include not working when called from shared borders

S

strazz

I have created a js include file and call the functions in it from the
bottom shared border.

I have placed the following include script line in the head section of
the bottom border page.

<script src="./scripts/gen_email.js" type="text/javascript"></script>

That would seem to me to be the logical spot for it, however, when I
preview the border page or any other page (that shares the border) I
get javascript errors.

I have discovered that I can overcome this problem by adding the above
line to each page that uses the border.

I get annoyed when I create a new page and forget to put the include in
it and get the errors.

Is this how it is meant to work?

Cheers
TonyS.
 
S

Stefan B Rusynko

FP include pages only include the content inside of the BODY tags
So you either
- put your script in the HEAD section of all pages using the Include
or
- move your script inside of the BODY tags of the include page (if the script works from there)




|I have created a js include file and call the functions in it from the
| bottom shared border.
|
| I have placed the following include script line in the head section of
| the bottom border page.
|
| <script src="./scripts/gen_email.js" type="text/javascript"></script>
|
| That would seem to me to be the logical spot for it, however, when I
| preview the border page or any other page (that shares the border) I
| get javascript errors.
|
| I have discovered that I can overcome this problem by adding the above
| line to each page that uses the border.
|
| I get annoyed when I create a new page and forget to put the include in
| it and get the errors.
|
| Is this how it is meant to work?
|
| Cheers
| TonyS.
|
 
A

Andrew Murray

the line <script src="./scripts/gen_email.js"
type="text/javascript"></script>
won't work
but put the gen_email.js in the _borders page and have the include line

<script src="gen_email.js" type="text/javascript"></script> might work

else have the 'double dot' rather than single dot preceding the first
forward-slash

<script src="../scripts/gen_email.js" type="text/javascript"></script>
 

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