quote:
Originally posted by Chris Boulton
quote:
Originally posted by CookieRevised
What happens if the creator hasn't access to a PHP enabled host?
Well, obviously if the user is creating it then he'd know he has PHP. You can't just say "bah, everyone without JS don't matter" You can't make predications on your visitors like that
Not all hosts include the ability to write php though. And some people who read this thread/question might wanna do the same on their (crappy) hosts.
quote:
Originally posted by Chris Boulton
quote:
Originally posted by CookieRevised
If it is only for redirecting, then yes (but isn't PHP doing this also in way?). But, just as in PHP, it can be used for far more things than only that.
In PHP, I wouldn't make it redirect, i'd make it seem totally transparent to the user and use an include() function.
yep, true, agreed, but I actually meant it as in:
in js:
1) the js script is loaded.... client side
2) depending on the switch the page is loaded.... client side
php:
1) the php script is loaded.... server side
2) depending on the switch the page is included, aka needs to be loaded also.... server side (if that is the only thing it is used for, because, again, I was not only talking about that specific use)
hence:
quote:
Originally posted by CookieRevised
(but isn't PHP doing this also in a way?)
If you only look at it as what is done server/client side, yep, only 1 thing gets loaded in php. But thus that was not what I meant with it though, sorry for being a bit vague there.
-----------------------------------
quote:
Originally posted by ShawnZ
But come on? Using the location.hash for that kind of thing is laughable coding. In fact, I highly suggest Methos2 avoids the suggestion.
1) using js for redirecting is perfectly sane (and frankly, quite often done all over the place, yes, even on these forums). Nothing laughable at all...
2) Using anchors for
only redirecting is less sane though, but can sometimes be the only possible way. again, nothing laughable at all in those cases...
quote:
Originally posted by ShawnZ
quote:
Originally posted by CookieRevised
What happens if the creator hasn't access to a PHP enabled host?
Well, at least there isn't a RISK involved in that.
Who's talking about risk? In fact, if you only talk about this specific use, then there is less risk for the user if some creator did it in javascript than if the creator did it in php. As the user can see the source of the (javascript) page and thus can see and have a clue of what it does. If it was in php, the user can only guess what it will do and hope for the best...
-----------------------------------
But all this is going towards what's best to use. I never ever said anywhere that javascript is the best thing to use over php. I only gave an alternative, nothing more, nothing less.
So no this wasn't off topic as both methods are extremely closely related and are alternatives for eachother in some specific uses. And thus I posted what I posted to make the picture complete.
eg/analogy: If someone asks to create a plugin so he can attach text to a custom sound, and you make a post about quicktexts than that isn't off topic either. Though quick texts have got nothing to do with custom sounds (even less than what anchors have to do with php) and plugins, it provides an alternative way to what the user, and people who might come across the thread, wants. Although the original poster asked his question in relation to plugins, he don't nessecairly meant he wants a plugin to do it; as long as the job gets done. He might simply don't know another method....
edit: @rav0: that can be the exactly what people might want in some cases. Don't dismiss it simply because of that. Remember that these anchors, and the equivalent in php, can also be used for other stuff than a simple redirection (eg: to parse info to a page and set some form elements or whatever).