On Jan 6, 6:20 pm, "Daz" <cutenfu
What you need to do if you want to give the user something to bookmark
window.location.hash = "whatever"
If you don't get what I mean by that just set up a simple page with
three buttons, each one's onclick could be "window.location.hash =
'1';", etc. and then you'll see what i mean.
So that allows people to save a particular state of your site. The fun
part comes in programming your code to remember this state. The way to
do this is to use the onload event. When the event fires your function,
you check the hash with if (window.location.hash == 'whatever') and
then you change the page's middle text to be whatever you want. There
are quite a few examples out there, just search for 'ajax', 'bookmark',
'state' and similar terms on google or whatever.
BUT, do you need an ajax website? Excuse me if I'm patronising you
here, but do you realise that you can have this permanent
php, asp, or whatever? If you don't know any of these server-side
languages it's not that hard to learn enough to get this header/footer
business going. What you'll need is something like the following:
In PHP (the language I use):
1 file called header.php containing:
This is the header.
This is the left-hand menu.
1 file called footer.php containing:
and then in each content page of your site (index.php, \bout.php,
contact.php, whatever) you have something like this:
<?php include("header.php"); ?>
Main content goes here
<?php include("footer.php"); ?>
That will give you your constant header/nav and footer through each
page, whilst keeping everyone as one downloaded page for the user.
Also, beacuse everything's on a separate page the user can bookmark to
Again, sorry if you are experienced in this stuff and just wanted to
know about ajax, but I thought I'd cover all of the bases.
Yes and no. To be honest, I am not entirely sure if I want users to be
able to bookmark any pages. My website is going to be a game, not what
I would call a regular site.
> Excuse me if I'm patronising you
> here, but do you realise that you can have this permanent
> php, asp, or whatever?
No, I don't find you patronising in the slightest. I know I am
seriously pushing the envelope to a level where it just might bite me
in the butt, but there are several things I would like to be updating
running in another frame in the background. If someone else in the
applet mentions the users name, I want the user to be notified within
5-10 seconds, even if they don't refresh the page. There are two many
sites around which try to be interactive, but rely on pages refreshes
too much, which can be seriously annoying. That's web 1.0 as we know
it. Pages are lifeless (apart from any animations you might have on the
page). It relys too much on the user to help themselves to the
responses (if you know what I mean). If you automatically refreshed the
page, you risk seriously ticking off the user. With pages updating
automatically, and behind the scenes, however, in such a way that it's
seamless. I think it has more potential to wow users than tick them
There will be a few HTML pages, but not many, and those pages will only
once the user logs in, I would like everything to run just like an
application. Also, I think it will be better for the server to only
send out small amounts of data, and also more responsive for the user.
In case you have already seen it, check out www.netvibes.com. This is
an example of a site that doesn't work without Ajax, yet it's good
pretty safe language to use, as you can't really do much intentional
damage at the users end due to restrictions, and therefore, there's
really no reason to disable it (IMHO).
I guess I just want to embrace the Web 2.0 revolution, and take full
advantage of it with Web 3.0 just around the corner. There may also be
one or two large-ish applications which would be best not loaded from
the server every time they are needed. I think I will do a Google, and
use an iframe to store the scripts. Just out of interest, have you ever
used GMail? It's pretty good. Although when you refresh, you get logged
in again. There is limited support for the back button, but I have
found the navigation to be good enough to not need to use either
refresh or the back button. That back button can be dangerous if used
incorrectly. It can resubmit post data, thus posting something more
than once, and having the potential to 'undo' changes that have already
been made. This is why I have decided to make my page navigation clear,
and easy, so the back button will become obsolete within my app. I am
presses, and alert them with a message. (inspired by the demo at
http://www.youos.com). I am sure you'll agree, the conept is excellent.
I am hoping to make a game like nothing anyone has ever seen before.
am hoping that the site will be that good that users are prepared to
keep it enabled. A lot of users don't even know how to disable
different. If you wanted to play a really good game on your PC, and it
wouldn't work because you didn't have Direct X installed, or something
similar, what would you do? My instinct is to think that you would do
what you need to in order to play it. I know I would. :)
Thank you very much for your input. I really appreciate it. :)