Click to See Complete Forum and Search --> : calling js from within js


venkusalo
07-06-2003, 10:03 PM
greetings,

I am preparing a template set for multiple users and would like to have a standard header at page top, and the users page set in a frameset (main site nav in left frame).

My thought was to create a document.write type .js (and hope the many folk don't delete the line from the template :)

I use a frame forcing script [ffs] so the left menu arrives even if a single page is loaded.

Q:
Is it possible to call the f.f.script from within the header.js ?

I hope my intention is clear.
Perhaps there are other ways to do this - suggestions anyone?

thanks,
|<

pyro
07-06-2003, 10:08 PM
I'm not sure I understand 100% what you are trying to do, but if you are just trying to include content on all your pages, I would highly recommend using PHP or SSI.

venkusalo
07-06-2003, 11:30 PM
dear pyro,

yes, basically I am trying to include content on every page.

no, I don't know much about php - even less (to nothing) about ssi

I can learn - bit in the meantime my thought was to put a line in each page:
<script language="javascript" src="in-all-pages.js"></script>

this .js would be primarily a series of document.write lines

one line would ideally call my frame-breaking.js (to ensure the main menu appears in the left frame).

tis a tangled web we weave - mostly fun :)

your thoughts?

thanks,
|<

pyro
07-07-2003, 08:18 AM
My thoughts would be to use PHP. The problem with using javascript is that 13% of your users will get nothing. You can include files like this:

<?PHP
include ("yourfile.htm");
?>

Make sure you give you files a .php extention...

venkusalo
07-07-2003, 03:47 PM
dear pyro,

many thanks for following this. I bumble about and learn along the way - with help :)

<?PHP
include ("yourfile.htm");
?>

where does this line go?
I presume in the page I wish to insert "yourfile.htm"
<HEAD>?
<BODY>?
I imagine where I want the contents of "yourfile.htm" to appear.

I also presume "yourfile.htm" is the 'header' I am aiming to include on all pages?

I am still not sure sure how to force the frameset
Does "yourfile.htm" have the .js forceframe script within it?

But then...
I am surprised to have you suggest that 13% of users will get nothing. I thought js was (almost) universal? Still, if 13% don't get the main menu this is not so bad.
Can you suggest another way to oblige the frameset? Of course I guess the whole thing could go in the header "yourfile.htm" - this might be easier.

thanks again,
|<