The best way? HTML/Javascript related

Locked
Kaz
Posts: 1077
Joined: Wed Mar 08, 2006 3:43 am

The best way? HTML/Javascript related

Post 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!
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: The best way? HTML/Javascript related

Post 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.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: The best way? HTML/Javascript related

Post 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.
Kaz
Posts: 1077
Joined: Wed Mar 08, 2006 3:43 am

Re: The best way? HTML/Javascript related

Post by Kaz »

Nice, thanks for the library suggestion, I'm okay with using others' wheels. :)
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: The best way? HTML/Javascript related

Post 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?
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Kaz
Posts: 1077
Joined: Wed Mar 08, 2006 3:43 am

Re: The best way? HTML/Javascript related

Post 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?
bitWISE
Posts: 10704
Joined: Wed Dec 08, 1999 8:00 am

Re: The best way? HTML/Javascript related

Post by bitWISE »

Here are the tweaks I made using Firebug that I think look better:

Image


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.
4days
Posts: 5465
Joined: Tue Apr 16, 2002 7:00 am

Re: The best way? HTML/Javascript related

Post 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 :)
Locked