Page 1 of 1
The best way? HTML/Javascript related
Posted: Thu May 14, 2009 2:23 pm
by Kaz
I've been working on a site for my professor,
http://www.cs.appstate.edu/sstem/, and I've used a simple javascript to load content into the main section. I did this because I felt it wasn't intelligent to have to reload all the static stuff on the sides/top. Everything is dandy except the browser caches these pages and you have to clear it to see changes. I've seen some HTTP stuff that "insists" that the browser update it's cache, but what would be the best way to go about this?
Also: aside from being cheesy, I was trying to get the side expanding box to look more like the ones at
http://myasu.appstate.edu/, currently my implementation is slow and primitive. Any ideas?
Code: Select all
function expand()
{
if(targetID.offsetHeight >= height)
{
targetID.style.height = height + 'px';
return;
}
else
{
targetID.style.height = (targetID.offsetHeight + 2) + 'px';
setTimeout("expand()", 1);
}
}
Thanks!
Re: The best way? HTML/Javascript related
Posted: Thu May 14, 2009 2:27 pm
by ^misantropia^
Websites that require Javascript to update content rank very low in search engines (because the spider doesn't execute the Javascript) so avoid that whenever possible.
Re: The best way? HTML/Javascript related
Posted: Thu May 14, 2009 2:28 pm
by ^misantropia^
Kaz wrote:Also: aside from being cheesy, I was trying to get the side expanding box to look more like the ones at
http://myasu.appstate.edu/, currently my implementation is slow and primitive. Any ideas?
Use a library like Prototype or jQuery to do the heavy lifting. No need to (poorly) reinvent the wheel.
Re: The best way? HTML/Javascript related
Posted: Thu May 14, 2009 3:31 pm
by Kaz
Nice, thanks for the library suggestion, I'm okay with using others' wheels.

Re: The best way? HTML/Javascript related
Posted: Fri May 15, 2009 2:30 pm
by obsidian
Kaz wrote:I've used a simple javascript to load content into the main section. I did this because I felt it wasn't intelligent to have to reload all the static stuff on the sides/top.
Shouldn't you be using PHP or some other server side script to do that instead?
Re: The best way? HTML/Javascript related
Posted: Thu May 21, 2009 5:16 pm
by Kaz
That's how I was doing it initially... I hadn't ever experimented with javascript so I might have gone a bit overboard. Either way, thanks for the replies, I changed it back and made them just static html pages, there isn't much need for fancy ajax-y stuff:
http://student.cs.appstate.edu/freemanc ... stem_real/
http://student.cs.appstate.edu/freemanc ... step_real/
http://student.cs.appstate.edu/freemanc ... idge_real/
I know this isn't a design forum but any suggestions for improvements/changes?
Re: The best way? HTML/Javascript related
Posted: Tue Jun 02, 2009 9:38 pm
by bitWISE
Here are the tweaks I made using Firebug that I think look better:
body background - make it #70e170
header.h1 - make the padding 1em
header background - make it same as body
header border - get rid of the top, set the bottom to 4px #323232
#content #right dt - give it the same green bg as body, change margin to the top only and make it 1em
#content #right dd - background #e0e0e0
footer - bg color same as body, border top same as header border bottom, color white, width 100%
Its all subjective of course. I'm a fan of generous spacing.
Re: The best way? HTML/Javascript related
Posted: Wed Jun 03, 2009 8:38 pm
by 4days
if you ever do need to make the site dynamic:
http://phpwebsite.appstate.edu/
haven't used it to be able to recommend it, but you shouldn't have far to go for tech support
