View Single Post

  #9 (permalink)  
Old 04-05-2008
Michael Fesser
 
Posts: n/a
Default Re: PHP_SELF, $_SERVER, etc

..oO(Sylvain SF)

>Michael Fesser wrote on 04/04/2008 11:58:
>>> hmm, what about: <a href="javascript:history.go(-1)">Back</a>

>> Ugly and unreliable.

>
>don't you trust your script engine ? change your script engine.


It's not about a scripting engine, but about ugly code. The javascript:
pseudo-protocol is just stupid, the entire link appears as non-working
to users without JS and even if it works it might throw the user back to
a completely unrelated page. Going back in the browser history is not
what the OP wants.

>> Yes, but JS is optional.

>
>(and in case available on 99% of the browsers).


Wrong. Just because most modern browsers support JS doesn't mean that
it's always enabled. And then there's a whole bunch of non-JS user
agents, for example search engines.

>> Server-side code works always.

>
>if it doesn't rely on client information. here it's the case.
>a server-side code will *not* always work, and thus is not
>reliable.


Wrong again. If it's done on the server, it's completely independent
from the client's capabilities, environment and network, whereas
JavaScript always depends on what the client is able to do and if he
will be able to execute it at all.

Micha
Reply With Quote