The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
home.html
transition.html
index1.html
index2.html
message.html
What I want is this:
When a user clicks on a link on the home.html page, they are taken to transition.html
Then, using a JavaScript, probably somewhere in there, there will be an IF/ELSE statement, the transition page will take you to a certain page depending on the page you were at last.
How do I do it?
> 1. Why have a transition page to do that? Just stick a single paragaph
> at the top of the page saying: "Please be patient, this may take
> a while to load." Then stick the rest of the page in a table so
> it loads all at once afterwards.
>
Which is not always possible, and entirely dependent on the pages and content thats being generated. Aside from anything else, you can say it looks poor to be still displaying a message thats no longer valid still at the top of the page once its finished loading. And one further issue which I'll mention below.
> 2. Why not just stick a note next to the link on the first page
> saying: "Please note, this may take a few minutes to
> load".
>
Why not indeed? Never said you shouldn't do that or that it wasn't a solution. Is that or point number 1 a better solution? Depends on what you want. Using javascript can certainly give you more control, and can be useful in scenarios where you can get servers that will timeout, and you don't want to leave the user left with a standard this page couldn't be displayed message.
> 3. If the transition page you need requires JavaScript, why not use a
> JavaScript alert() function when they click the link? At least this
> way if they don't have JavaScript then they will just not see the
> alert rather than not seeing the entire page because the transition
> page won't redirect them.
>
> Scenarios B, C, D and E being what? It is very bad design to create a
> site that relies on JavaScript for navigation, so I assume the other
> scenarios take this into account?
So by your definition most (since javascript is the most popular language for writing them) DHTML sites are very badly designed, ok. :P
Anyway, you assume far too much. You aren't thinking beyond a pretty web site that sits on the web that everybody can access and caters to lowest common demoninator. If I develop for an intranet for example, I may have control over all machines, I may have control of their browser settings, I might be able to even decide what browser and what version they use if necessary. If I decide to use javascript, then there certainly won't be any browser that has javascript turned off scenarios.
And especially on an intranet you can be very keen to keep as much stuff client side as possible, ie I don't go and ask for the webserver where to direct me to, I use javascript to do it.
There is no right or wrong answer to this, no better solutions, just some are more appropriate to different situations. And only a fool thinks otherwise in my opinion.
> -Scenario A, I've got 20 pages on my website, 10 of which are pages
> that generally take a long time to load, say 2 or 3 minutes. In which
> case I point all of those 10 pages to my transition page, which says,
> "hey, this page is gonna take a while to display, please be
> patient", I then redirect them to the page based upon where they
> came from.
OK:
1. Why have a transition page to do that? Just stick a single paragaph at the top of the page saying: "Please be patient, this may take a while to load." Then stick the rest of the page in a table so it loads all at once afterwards.
2. Why not just stick a note next to the link on the first page saying: "Please note, this may take a few minutes to load".
3. If the transition page you need requires JavaScript, why not use a JavaScript alert() function when they click the link? At least this way if they don't have JavaScript then they will just not see the alert rather than not seeing the entire page because the transition page won't redirect them.
Scenarios B, C, D and E being what? It is very bad design to create a site that relies on JavaScript for navigation, so I assume the other scenarios take this into account?
> Garin wrote:
> Give me one reason why you would want to use that method of linking...
-Scenario A, I've got 20 pages on my website, 10 of which are pages that generally take a long time to load, say 2 or 3 minutes. In which case I point all of those 10 pages to my transition page, which says, "hey, this page is gonna take a while to display, please be patient", I then redirect them to the page based upon where they came from.
Can have scenarios B,C,D,E etc.. if you really want.
I already stated that I didn't believe Twain had any real reasons to use it but I think he should find that out himself rather than being offered, "I'll help you do what I want you to do not what you want to do." type thing.
> From a professional coder's point of view, etc..
>
The issue isn't whether its a good idea or not. There are many reasons to use what he wanted, but given his initial post I doubt very much he does have much reason beyond he wants to try it. He will learn himself whether its what he wants, whether its a good idea etc. on his own. That is a far more valuable learning experience than some foolish person coming along and trying to tell him what he should be doing, you know?
You knew what he wanted, its a trivial thing, if you really wanted to help him, you could of given him the code, and then explained why it might not be a good idea and that their are better solutions. And you could have done that in much less time than you spent posting on this thread so far.
> Does it matter what the point is? He asked how to do something, does
> he need to justify it before somebody will tell him?
Yes it does matter. I have got a lot of other things I could be doing with my time. I don't mind helping people out with scripting for their web sites - I like seeing people have fun whilst doing something challenging.
But at the same time, if he is going to do something which is trivial, and he said himself he will see when it is done whether it is worthwhile keeping or not, then I would rather not waste my time doing it.
From a professional coder's point of view, I personally think that:
a) Using a transitional page for links is pointless because:
i) It will be slow
ii) It is difficult to code compared to an tag
b) Requiring people to have JavaScript to follow links on the site will put off users
c) Using JavaScript is a messy way of doing it, and if it was going to be done, why not use PHP/Perl/ASP etc which would do it all behind the scenes?
> But what is the point of:
>
> Main Page Transition Page New Page
>
> which requires them to have JavaScript installed, when you could just
> do:
>
> Main Page New Page
>
> with a simple hyperlink. What do you gain from the first method?
Does it matter what the point is? He asked how to do something, does he need to justify it before somebody will tell him?
Twain,
quite rusty with javascript but if I understand correctly what it is you're trying to do you want a function something like...
function redirect() {
if (document.referrer== 'http://www.twaincommunity.tk/home.html') {
top.location= 'http://www.twaincommunity.tk/index1.html';
} else
if (document.referrer== 'http://www.twaincommunity.tk/index1.html') {
top.location= 'http://www.twaincommunity.tk/index2.html';
}
}
And you want to add onLoad="redirect()" to the body tag of the transition page. I guess you'll get the idea though. You might have to play around with it a bit, don't remember if the http:// is included in the document.referrer field or not.
I've not syntax checked it or even really tested if it works properly, although I do know that document.referrer might not be set if you try the pages locally (ie on your HD rather than uploaded).
If its wrong, I'm sure they'll be plenty to correct me and at least you'll get your code then. :)
If this isn't what you mean, then a better description would be in order. :)
> yeah, CGI is an interface (Common Gateway Interface) which can be used
> by lots of languages such as PHP and Perl...
That's the thing. I didn't want to use PHP or CGI for it. Mainly because I couldn't be bothered to learn them when I learnt HTML and JavaScript. I didn't think I'd ever use them.
> What we mean is, what's the point in the script? Why do you want it?
I want to test it on a website that I am making. If it looks good, I'll keep it and use it when the site goes online. If it doesn't, then I'll drop it. The idea was inspired by Ikonboard. (http://ikonboard.com)