View Full Version : Algorithm Feasibility Questions

08-25-2007, 01:18 PM
I am rather inexperienced when it comes to web development. I believe I have come up with a plan for how to do what I need to do, I need some direction as to whether this is the simplest implementation and/or where to go for help.

I want to create about five *Div*s using JavaScript and the DOM, I would like to have the text in these Divs be imported from an already existing html files. Because I'm lazy and there just has to be a better way than retyping all this content into a CreateTextNode method. I'm guessing that Server Side Includes is the way to go with this, but really have no clue on how to make that really work, or even if it's the way to go.

Once I have the *Div*s, then I am planning on using OnClick events to make them appear and dissapper using the visibility attribute. Does that sound like a good idea?

TIA for any advice and reccomendations.

08-25-2007, 03:28 PM
This sounds as if using Ajax would be your best bet. The text to be included can be loaded as needed when the page is loaded (or on demand), and then used to populate your divs.

You should also look at using the display property rather than the visibility property. Visibility: none still used space, display: none does not.

John Rostron

08-25-2007, 04:26 PM
hm... inexperience can be trated, but laziness...?:) Whichever solution you will choose you must experience it and get rid of laziness. Nothing is simple these days...

Use includes. PHP includes. It is nothing fancy, except that your files should bear php extension, should be correct formatted (Doctype) and your server should accept php work on it. Google for PHP tutorials, includes, begginer, or things like that... :)