Ooh, Scott, I'm so sorry, I've just realised a problem.

Since the path to the 'facts' directory is relative, it only works for
'parent' HTML files on the one level. I have a homepage at the root
level (eg: keep/default.htm), and then various other pages one level
further in (eg: keep/why/default.htm). With the current code, these
deeper ones don't display the includes because the relative path isn't
right for those pages.

I suppose I could add a class of "one" to the body of the home page,
and then a class of "two" to the pages one directory in, and then
"three" to pages another step in... and then use individual $
(body.one).ready(), $(body.two).ready()... etc calls in my jQuery
code. But it's a bit ugly.

Is there an easier way which doesn't involve adding a class to each
body element?

Thanks.

~ Zarino




On Jun 27, 11:38 pm, Scott Sauyet <[EMAIL PROTECTED]> wrote:
> zarino wrote:
> > Excellent! That was it. It all works brilliantly now. :-D
>
> > As a side-note: Am I being really picky here, or could the contents of
> > facts.js and custom.js be combined into one file? Seems a shame to
> > have a whole separate javascript file containing just one line of
> > code.
>
> That would be fine.  The only reason I thought they should be separated
> is that the list of facts is likely to change regularly; the other
> should remain static.  If you have other JQuery on the page, you can put
> it together with what's in "custom".  I guess it's  simply a way to
> separate the dynamic data from the code.
>
> Good luck,
>
>    -- Scott

Reply via email to