Page 1 of 1
js requirement
Posted: Tue Dec 12, 2006 7:04 am
by reecec
hi
Sorry as this isnt really about php but from experience as coders do you think it would be a problem to say they cant use it unless javascript is enabled or will i have to do all the pages again for people who dont have javascript for the confirmations of deleteing
thanks reece
Posted: Tue Dec 12, 2006 7:22 am
by matthijs
Well, the answer to that question depends on a lot of factors.
- Do you have users who are not able to use javascript (using alternative devices, mobile phone, old browser?)
- Do you have users who don't want to have javascript enabled (maybe a few % of regular webusers)
- Is the application openly accessible? yes? Then you will have "users" who disable/ignore javascript to try and mess with your system
The answer to the first 2 questions should tell you if it's a good idea to make javascript a requirement. in other words, who is your audience?
The answer to the last question is more related to security issues related to your app.
Posted: Tue Dec 12, 2006 7:23 am
by CoderGoblin
Generally I design a page without javascript. Then once this is done I enhance it with javascript if appropriate. You then have a site which will work for most people but with an enhanced experience for those with javascript.
I do not use javascript for alerts/confirmations etc as I normally find them ugly (i know you can snazz them up but in my opinion it is not worth the effort).
As has already been mentioned in one post (not sure which though) the main problem is not catering for people not having javascript switched on, but those people who do not have access to it (due to using a screenreader etc for "accessibility"). I personally think very few people switch javascript off. I have heard figures like 10% but in my experience this is not the case.
Posted: Tue Dec 12, 2006 8:40 am
by reecec
Thanks.
my script will not be open, it will be only for registered paied users. It will just be used on the a pc not mobile.
The js will only be used for confirming delete which is not a problem if js is turned of it will just not delete.
It is a pain to make the confirmation in a seperate php file as i have to keep carry the variables through hiding them in forms and stuff does anyone area that its more simple just to use js for promting
thanks reece
Posted: Tue Dec 12, 2006 8:46 am
by CoderGoblin
There are alternatives to passing the delete list...
Have you thought of using storing the delete list in a session ?
The processing of the delete list doesn't have to be in a separate file. You just need to check if $_POST['confirm_del'] is set.
Posted: Tue Dec 12, 2006 8:52 am
by reecec
yes i supose i could do it alot easyer then i may have been doing
but would i still use a seperate file
choose delete -> check -> drop
thanks reece
Posted: Tue Dec 12, 2006 7:32 pm
by RobertGonzalez
You can uses phases within the same PHP script. Step 1, step 2, etc. I personally think it is a bad idea to rely on javascripting for anything that is critical to the operation of your application. If it is used to make things fancy, the all the better, but when you are using it for validation, confirmation, restriction, then you are asking for trouble.