Post by myshadowself » Wed Jun 08, 2011 5:20 am

Hi

I'm new to OC but I'm an experienced web developer.

One thing I've noticed is that there are alot of JS redirects or JS form submissions, which kind of throw up the question of accessability.

Many of these things prevent the user using the back button, or prevent the user submitting forms at all should they have JS disabled.

So Im wondering, what is the reason for doing it like this? Am I missing something important in the whole idea?

It's not a criticism, I'm just trying to get my head around how (and why) everything works by sparking a healthy debate

Cheers

Andy

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

Post by Johnathan » Wed Jun 08, 2011 5:56 am

I agree that Javascript is used in places it doesn't necessarily need to be. However, since Javascript is required to checkout, to me it doesn't really matter since the main functionality of the cart (i.e. making sales) doesn't work without it.

It would be great to have all the code fall back to something that doesn't require Javascript, but I don't think that's on Daniel's agenda for the future.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by myshadowself » Wed Jun 08, 2011 6:18 am

Agreed on the fallback, definitely. It's the way the web is going really - code for everyone if we can

I've been going through the code (as I create my custom template) and adding fallbacks where I can. It's a case of rebuilding any forms as if AJAX hadn't been invented, leaving JS to do the job if enabled and html if not. Seems to be working OK, but I haven't got to the checkout part yet.

I take it Daniel is the brains behind OC, well, accessibility should really be on everyones agenda. Imagine missing a sale because a user doesn't have JS enabled...keeps me up at night does that possibility!

OC appears to have a fantastic future ahead of it though, it's quite an exciting cms to work with (albeit alittle confusing at times).

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

Post by Qphoria » Wed Jun 08, 2011 10:10 am

myshadowself wrote:Agreed on the fallback, definitely. It's the way the web is going really - code for everyone if we can
5 years ago maybe. But that ideal was dropped as html5 was gaining ground. Html5 was then massively delayed but people supported bothering since jquery could mimic flash designs and about 2 years ago all browsers got a huge jscript boost in speed. Web 2.0 is here and fallback is dead.

Zencart tried and sacrificed joining the 21st century in technology which is why it is on the decline.

I do agree tho that a lot of the links that use onclick instead offered should not be there. But fallback is a value of the past IMO.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SapporoGuy » Wed Jun 08, 2011 10:16 am

Difficult decision here ... this could be an issue since ie6 is being supported but not a fallback for JS ... seems like double standards regarding technology.

Personally, I am with moving to the 21st century :)

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by Xsecrets » Wed Jun 08, 2011 10:17 am

myshadowself wrote: Imagine missing a sale because a user doesn't have JS enabled...keeps me up at night does that possibility!
man hope you have some good drugs to put you to sleep if something like loosing a sale from the 1 person in a million that have javascript disabled keeps you up at night. How do you manage to step out of the house? :choke:

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Xsecrets » Wed Jun 08, 2011 10:18 am

SapporoGuy wrote:Difficult decision here ... this could be an issue since ie6 is being supported but not a fallback for JS ... seems like double standards regarding technology.

Personally, I am with moving to the 21st century :)
personally I would say ditch ie6 support. pretty much every large website already has.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Wed Jun 08, 2011 11:26 am

I'd recommend simple <noscript> tags and be done with it. That is your best failsafe method at this point. Realistically, the only people who know how to turn off javascript are the same people who know how to turn it on.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SapporoGuy » Wed Jun 08, 2011 4:15 pm

:laugh: how true!

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by myshadowself » Wed Jun 08, 2011 5:05 pm

oooo, good debate - I like!

The problem is as business people we have to sell to our markets.

If we're selling gadgets, then yeah, fallbacks are pointless as this type of customer is net savvy and love all the funky jQuery stuff.

If, like me, you're selling to businesses, then you have to realise that most businesses will still believe cookies can watch you in your sleep. Most businesses have things like JS turned off and locked off by passwords. Infact, most still run IE<8 on an XP machine. I'm yet to walk into a business HQ running anything but XP, and only found 1 where the majority are using a proper browser like FF. At the moment, it is not economically viable to be unaccessible.
Xsecrets wrote: man hope you have some good drugs to put you to sleep if something like loosing a sale from the 1 person in a million that have javascript disabled keeps you up at night
You have a million customers? Well done, most businesses can't afford the luxury of missing a single sale, especially when it's avoidable. And one sale leads to another and another in B2B, so that one missed sale could have ended up being the best customer ever, spending 100's of 1000's.
Qphoria wrote: ...Web 2.0...
Web 2.0 was a bullshit marketing gimmick created by the Americans to sell big arse buttons and shitty oversized logos. Web 2.0 is dead - accessibility is king
Qphoria wrote: But fallback is a value of the past IMO.
IMO, fallback is a key element in creating accessible websites. With the plethora of new devices available, we have no choice but to make our sites accessible to all, including smartphones, which, let's face it, aren't all capable of running javascript or flash yet. Infact...
Qphoria wrote: ...html5...
...was created to do away with the need for 3rd party plugins such as flash simply because it's too intensive for smartphones, which are now making up for a massive percentage of web traffic. But we're looking at 2022 before it becomes the standard - 11 years to get the accessibility mentality into OC.
Qphoria wrote: I do agree tho that a lot of the links that use onclick instead...
Overall, we are on the same wavelength. Even if we're relying on jQuery, we shouldn't be relying on "onclick" when jQuery has it's own event that can be used outside the scope of the document and thus avoid the html code bloat that OC has (inline JS, inline CSS all over the place).

I'd like to make it clear that I'm not trying to flame at all- I've only recently fallen in love with OpenCart and as we're still in V1, I think now is a good time to open debates like this so that V2, V3, V4, V5 will be incredible. Some web standards would really improve it for the future.

As always, I come in peace.

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

Post by SapporoGuy » Wed Jun 08, 2011 5:45 pm

web 2.0 was ok, it's just that html 5 was hyped as the savior but is still a few years away.
However, that 11 years is for the implementation to finalized ... in reality, 2-3 years for most browser to accept fact and then it's just a game between google, apple and M$ to decide when html5 gets the big grand daddy ok ;)

I can see your point about businesses but ... B2B is on a much higher level then then cube cubbies who shouldn't be wasting their time on FB, twitter and shopping for X-mas ;)

Now my question is ... how much is jquery affected by having javascripts bad rep?
and lol, yes, cookies are dangerous ... ;) At least my last batch wasn't burned :laugh:

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by myshadowself » Wed Jun 08, 2011 6:30 pm

SapporoGuy wrote:Now my question is ... how much is jquery affected by having javascripts bad rep?
It's completely affected - jQuery is a javascript library - if JS is off, no jQuery

It is the best library though, wonderful to work with and soooo extensible - I love it

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

Post by SapporoGuy » Wed Jun 08, 2011 6:36 pm

I actually like it a lot too. I skipped the mootools and the others in the beginning ...

One possible solution is to have a notice show when JS is off.

I wonder what the percentage of users have JS turned off is?

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by myshadowself » Wed Jun 08, 2011 7:45 pm

W3c: http://www.w3schools.com/browsers/browsers_stats.asp

5% of overall web traffic as of 2 years ago, but, that was before the real handheld and tablet boom. It also depends on the audience of each site really. Like I said, Gadgets it will be lower, B2B or education it would be much higher.


One site my company manages provides free resources for Education, almost exactly 50% of traffic is on a school, college or university network (I have a business plan that includes OC). Stats for non-JS are currently sat at 15.72%.

Now I know that users from a school, college or uni network aren't likely to be on an e-commerce site, but the network set ups for schools aren't a million miles away from those in businesses. And let's face it, the average business has alot more money to spend than your average web surfer So if that stat above is anywhere near, then a 6th of my rich-arse-wanting-to-spend-a-fortune customers are being bombed.

Hence the sleepless nights!

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

Post by Xsecrets » Wed Jun 08, 2011 9:24 pm

myshadowself wrote:oooo, good debate - I like!

The problem is as business people we have to sell to our markets.

If we're selling gadgets, then yeah, fallbacks are pointless as this type of customer is net savvy and love all the funky jQuery stuff.

If, like me, you're selling to businesses, then you have to realise that most businesses will still believe cookies can watch you in your sleep. Most businesses have things like JS turned off and locked off by passwords. Infact, most still run IE<8 on an XP machine. I'm yet to walk into a business HQ running anything but XP, and only found 1 where the majority are using a proper browser like FF. At the moment, it is not economically viable to be unaccessible.
What kind of business are you selling to? I worked in corporate IT for years. I've worked at 100's of businesses and talked to people at 1000's and Not once have I ever seen a business that turns javascript off. Granted there are a few businesses still stuck on ie6 and XP, but I'd say the mass migration away from that has already begun.
Xsecrets wrote: man hope you have some good drugs to put you to sleep if something like loosing a sale from the 1 person in a million that have javascript disabled keeps you up at night
You have a million customers? Well done, most businesses can't afford the luxury of missing a single sale, especially when it's avoidable. And one sale leads to another and another in B2B, so that one missed sale could have ended up being the best customer ever, spending 100's of 1000's.
no I don't have a million customers meaning the chances of me having one with javascript turned off is so close to 0 it might as well be an impossibility.
Qphoria wrote: ...Web 2.0...
Web 2.0 was a bullshit marketing gimmick created by the Americans to sell big arse buttons and shitty oversized logos. Web 2.0 is dead - accessibility is king
Qphoria wrote: But fallback is a value of the past IMO.
IMO, fallback is a key element in creating accessible websites. With the plethora of new devices available, we have no choice but to make our sites accessible to all, including smartphones, which, let's face it, aren't all capable of running javascript or flash yet. Infact...
Qphoria wrote: ...html5...
...was created to do away with the need for 3rd party plugins such as flash simply because it's too intensive for smartphones, which are now making up for a massive percentage of web traffic. But we're looking at 2022 before it becomes the standard - 11 years to get the accessibility mentality into OC.
maybe flash, but if a phone doesn't support javascript I wouldn't call it "smart".
Qphoria wrote: I do agree tho that a lot of the links that use onclick instead...
Overall, we are on the same wavelength. Even if we're relying on jQuery, we shouldn't be relying on "onclick" when jQuery has it's own event that can be used outside the scope of the document and thus avoid the html code bloat that OC has (inline JS, inline CSS all over the place).[/quote]
the inline css has been removed.
and yes the inline js could be removed from some of the links, but you still have the problem that the checkout will not work without js, so it'll not work on non js devices anyways.[/quote]
I'd like to make it clear that I'm not trying to flame at all- I've only recently fallen in love with OpenCart and as we're still in V1, I think now is a good time to open debates like this so that V2, V3, V4, V5 will be incredible. Some web standards would really improve it for the future.

As always, I come in peace.
web standards are a great guide, but there is a reason that pretty much all sites deviate from them in one degree or another. It's just not feasible to do a completely standards based site.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by myshadowself » Wed Jun 08, 2011 10:33 pm

Xsecrets wrote:but you still have the problem that the checkout will not work without js
Ah, that is the only real issue, and I agree it is a problem so have done some delving.

As far as I can make out, the only reason it will not work with JS is because it has been made that way and the only part of the process that fails with JS disabled is the final confirming of the order.

Have a play: If you add something to your cart, you can follow the full process up until "Confim Order" simply by changing the URL in the browser (I'm on 1.4.9.5 - I'll be doing my next site in 1.5.? where I understand it's a single page checkout).

index.php?route=checkout/cart
index.php?route=checkout/shipping
index.php?route=checkout/payment
index.php?route=checkout/confirm

So all that could be acheived through standard links, or form buttons easily enough.

Clicking the "Confirm Order" button sends an (empty?) Ajax request to index.php?route=payment/cod/confirm which, if you access this URL directly, will confirm the cart without any output and the entire order is sent with email confirmations.

Once that Ajax request returns success, the javascript redirects to index.php?route=checkout/success so all we really need to do to make it work sans-javascript is add a header redirect in (I think) model/checkout/order.php where the order is processed (correct me if Ive got the file wrong, still finding my way).

That would handle everything and we fallback to standard form buttons. We're doing a redirect anyway, so there's little point in using Ajax.


What I'm trying to get across is that there are no real problems in what I'm suggesting. I'm not just some spiv who's read an article about accessibility trying to get everyone to change their ways so I can feel good about myself. I can actually help with development and ideas for improvement. I'm offering a fresh pair of eyes and plenty of experience in all the languages OC utilises (as a developer, as a project manager and as a salesman).

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

Post by Qphoria » Wed Jun 08, 2011 11:10 pm

<noscript>
That is the final answer.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by myshadowself » Wed Jun 08, 2011 11:41 pm

It is AN answer I suppose, but not a very good one and certainly not THE final answer.

What would you add between your <noscript> tags? "sorry, we don't want your money because you don't have javascript enabled" - <noscript> isn't going to make the cart work all on it's own, so it's a way to present an excuse rather than a solution.

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm
Who is online

Users browsing this forum: No registered users and 36 guests