Page 1 of 1
Javascript for a navigational bar
Posted: Thu Feb 01, 2007 12:58 pm
by jdhorton77
I'm trying to come up with a navigation bar and I have a good idea for the logic, but I'm coming up with a kink in my plan. Here's my situation. I want to populate an array with anchor tags of the history object. I know that you can go back previous pages with history.go(-2) but I'm not sure how to check the url of the history without it loading the page. I'm trying to check the url of the history to reference a list of url's so I can write whether it's the home page, gallery, or what have you on the navigation bar. Anyone got any ideas?
Posted: Thu Feb 01, 2007 1:29 pm
by nickvd
What would happen to your navigation menu if the user does not have javascript enabled?
Posted: Thu Feb 01, 2007 1:48 pm
by jdhorton77
Good question, didn't really think about that. Do alot of people disable Javascript? I guess I could just enclose it with html comment tags to disable the script.
Posted: Thu Feb 01, 2007 1:53 pm
by Luke
I wouldn't use javascript. I'd set up some kind of system where depending on the page you are on, php (or some other type of server-side technology) knows how to build a path of links to that page. Depending on browser history is just asking for trouble.
Posted: Thu Feb 01, 2007 2:09 pm
by jdhorton77
Yeah, I actually just found a tutorial stating how to creat a "Breadcrumb Trail" using the directories to the current page. I guess I could do this, but the problem is that if a page goes from an http to https protocol the directories are two different locations. For instance, lets say a user logs in and is located at the user home page within the https directory. If the user wants to view the image gallery, within the http directory. Then move to customer check out, which is back in the https directory, then the navigation links will be all screwed up. Any comment on this perdicament?
Also, I have thought about placeing the majority of the pages within the https directory to fix this problem. What are the consequenses of this. Is there a great difference in transfer time between https and http? And what other problems do you see arising from this?
Posted: Thu Feb 01, 2007 4:30 pm
by feyd
We've had a few discussions on breadcrumbs..
