DBY
Who's Online
0 registered (), 7 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Latest Photo Gallery
light pole in the water
Eastern State Penitentiary - Philadelphia
Top Posters (30 Days)
Anartist 14
HarryB 12
Goofy 10
FinalDJ 10
m2h 8
Fitzy 5
Meph 2
Doorslammer 1
Nightowl 1
Dough 1
Topic Options
#160229 - 01/06/09 08:05 PM need javascript funciton help...
Frollard Offline
911, do you need police, fire, or ambulance?

Registered: 01/13/02
Posts: 4948
Loc: Canada
I'm sure this can be done with something complex like xml/css

...I want the footer at the bottom of each of ~20 pages to have the same info - copyright, etc. I'm looking for a function that can poll the server for a text file, no formatting, just 1 sentence that says something like "Copyright, company, 200x"

That way I wont have to update all the pages, just the text. It's already using and referencing a css file for formatting - can you store variables in there, then have a script poll that variable and draw it in the footer?
_________________________
In a world where the blind leads the blind, who do you follow?

Top
#160232 - 01/06/09 08:26 PM Re: need javascript funciton help... [Re: Frollard]
WeerDo Offline
King of the Ewoks

Registered: 06/10/01
Posts: 3921
Loc: New York City
something really quick n dirty, but does what you want...

make a footer.js file on the server, and in it have one function.

Code:
function writeFooter(){
    Response.Write("Copyright Frollard enterprises LLC 2009");
}


"include" the footer.js file in the header of the html files.

ans where your footer should be, call writeFooter()


now... whenever you need to change it, just change the text in the footer.js file on the server.

Top
#160238 - 01/07/09 02:34 AM Re: need javascript funciton help... [Re: WeerDo]
Mr_Blog Offline
human

Registered: 06/06/01
Posts: 13762
Loc: ${PWD}
You can also do it in the CSS:
body:after { display: block; content: "Copyright Frollard enterprises LLC 2009"; padding-top: 4px; }

Works in Firefox, not tested elsewhere.
_________________________
( o_
/ >) My 84-year-old non-techy mom uses Debian Linux. It ain't that hard.

Top
#160242 - 01/07/09 04:24 AM Re: need javascript funciton help... [Re: Mr_Blog]
Frollard Offline
911, do you need police, fire, or ambulance?

Registered: 01/13/02
Posts: 4948
Loc: Canada
Thanks for the help!

In body:after can I put other html? The footer is currently in a table all by its lonesome. I've never actually used CSS; so its still a mystery to me.
_________________________
In a world where the blind leads the blind, who do you follow?

Top
#160243 - 01/07/09 05:30 AM Re: need javascript funciton help... [Re: Frollard]
Mr_Blog Offline
human

Registered: 06/06/01
Posts: 13762
Loc: ${PWD}
Quote:
In body:after can I put other html?
I know you can add files, but I've never tried with anything but images and text strings.

content: url("myimage.png")
I think the url is relative to the css file, but can't remember clearly.
You migt find something here
http://www.w3.org/TR/CSS2/generate.html


IMPORTANT: I just read that this isn't supported by IE. I can't say from experience.
_________________________
( o_
/ >) My 84-year-old non-techy mom uses Debian Linux. It ain't that hard.

Top
#160327 - 01/08/09 12:29 AM Re: need javascript funciton help... [Re: Mr_Blog]
Frollard Offline
911, do you need police, fire, or ambulance?

Registered: 01/13/02
Posts: 4948
Loc: Canada
Thanks for the update and heads up!
_________________________
In a world where the blind leads the blind, who do you follow?

Top



Moderator:  Doorslammer, Nightowl, NightShade, Rez 
Shout Box

Today's Birthdays
No Birthdays
May
Su M Tu W Th F Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31