Response title
This is preview!
The Firebug error I get is:
TypeError: n is undefined
...luemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_val...
It's a reference to this code:
My forte' is PHP, not JS, but I know my way around well enough in JS. So, if you know of a temporary fix until you implement this feature, or you can clue me in as to what's causing this issue, I'd like to know.
With your tagline being "Write less, do more" you really should make it so that sliders use aria values for their min, max and value attributes.We do support ARIA, you've even pointed this out yourself. To have this actually be clear, you should have explained either your use case or the problem you were having. You seem to be saying that slider doesn't read ARIA attributes for the initial options. That would be correct. Slider has default values for min, max, and value, so they need to be explicitly provided. We can change the implementation to read the ARIA attributes, but I'm honestly not sure they should exist in the markup prior to having the actual behavior.
There were at least 3 old projects I came across to fix this behavior, yet the stock implementation never even allowed for such.The number of old projects is irrelevant. Based on this statement though, it seems like you've been using slider for a while, without ARIA, and everything was working fine for you. Why did you go back to add the attributes yourself? Did you get complaints about accessibility issues?
I have to literally create new JS to implement each slider I want to use. It's impractical.You make writing a few lines of JavaScript sound extremely laborious, or ridiculous for a web developer to be doing. Anyway, this statement isn't true. Widgets are designed so that you never need to do the same thing for every instance. You can very easily add this functionality in a few lines of code and have it work for every instance.
So, please, allow us to write less and do more by implementing common basic functionality that everyone expects to have at their disposal.Let's be honest. The use of ARIA attributes today is not "common basic functionality that everyone expects to have." Most developers don't even know ARIA exists. When it makes sense, our widgets do read in existing ARIA attributes. But as I said, it's not clear to me that this is one of those cases. We'll need to have a larger discussion about this with the accessibility community to determine if this should be implemented.
Just so you know, I tried the following and I can set the values for the slider as well as the max value, but when I try using this method to set the min value, I get issues (near a TODO in the code, mind you) telling me that "n" is not defined.That's not a helpful statement. The TODO has nothing to do with the min value, and providing an error from minified code is really annoying. Not to mention, you didn't actually provide a stack trace or anything useful.
lol I thought it was rather clever. =PLet's reduce the dramatics, please.
Why is this?We can change the implementation to read the ARIA attributes, but I'm honestly not sure they should exist in the markup prior to having the actual behavior.
I cited the number to help you to see that it's something people like. ( Filament Group, Fluid Project, and I can't remember/find the third one right now ) The fact that they are old projects, was stated because I'd rather keep my JQuery and JQuery UI components up to date while creating a new project. It allows for longevity of the project without having to rewrite the code later to satisfy possible new standards. (Ex. I'm writing my project using HTML5 as well, which has many new standards in it. It's new "range" input type is not supported in all browsers, yet, so I'll be using the JQuery-UI slider instead.)The number of old projects is irrelevant. Based on this statement though, it seems like you've been using slider for a while, without ARIA, and everything was working fine for you. Why did you go back to add the attributes yourself? Did you get complaints about accessibility issues?
Writing multiple lines of code is normal, and the amount of code that you need to write to actually have a functioning Slider is a small amount. However, if I have 5 sliders with different ranges (Ex. If the config screen uses sliders vs drop down boxes) then I have to write new code for each range I need.You make writing a few lines of JavaScript sound extremely laborious, or ridiculous for a web developer to be doing.
I'm not sure what you mean by this. I know that with multiple sliders, like with your equalizer example, you can specify the current value for the slider in the span element and it gets read. That's great, but the range can't be set on the element using it if the defaults aren't right for the situation and multiple values for a range slider can't be set on the element. (To my knowledge.)Widgets are designed so that you never need to do the same thing for every instance. You can very easily add this functionality in a few lines of code and have it work for every instance.
If that's true, then I didn't realize that. Whenever I'm working on JQuery based projects, I've always seen ARIA values being used. People mention it all over the place, it seems, along with some code using data- whenever I'm looking for how to do something with JQuery. data- could be used, but I prefer aria- for it's usage as an accessibility attribute. With JQuery using ARIA in it's code, it makes sense to stick with ARIA, instead of data-, to keep things consistent.Let's be honest. The use of ARIA attributes today is not "common basic functionality that everyone expects to have." Most developers don't even know ARIA exists. When it makes sense, our widgets do read in existing ARIA attributes. But as I said, it's not clear to me that this is one of those cases. We'll need to have a larger discussion about this with the accessibility community to determine if this should be implemented.
I'm glad I could annoy you. That's what I live for. =) Now, seriously, I already told you that I don't know JQuery very well, much less how to create debug code for a stack trace on top of it all. If it's easy enough to get a stack trace, please tell me how, as I might be able to solve my own problem more readily.That's not a helpful statement. The TODO has nothing to do with the min value, and providing an error from minified code is really annoying. Not to mention, you didn't actually provide a stack trace or anything useful.
I hope it's an error in my code so I don't have to wait for updates. I just don't know where it would be. As per your request for the jsfiddle bit, here you go.We'll look into whether we should be parsing ARIA attributes on initialization, but the error your'e getting sounds like an error in your code. Please either ask for help in the Using jQuery UI forum, IRC, or Stack Overflow; or create a reduced test case (on jsbin or jsFiddle) showing that passing a valid value to the min option is causing an error.
© 2013 jQuery Foundation
Sponsored by and others.