Skip to content

Fix documentation for .val() #939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

aried3r
Copy link
Contributor

@aried3r aried3r commented Jun 16, 2016

@jquerybot
Copy link

Thank you for your pull request. It looks like this may be your first contribution to a jQuery Foundation project, if so we need you to sign our Contributor License Agreement (CLA).

📝 Please visit http://contribute.jquery.org/CLA/ to sign.

After you signed, the PR is checked again automatically after a minute. If there's still an issue, please reply here to let us know.


If you've already signed our CLA, it's possible your git author information doesn't match your CLA signature (both your name and email have to match), for more information, check the status of your CLA check.

<argument name="value" type="String" />
<return type="String" />
<argument name="value" type="String" />
<return type="String" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I leave the trailing whitespace as is or is it fine?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespaces should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mgol
Copy link
Member

mgol commented Jul 6, 2016

LGTM.

@mgol
Copy link
Member

mgol commented Jul 6, 2016

Sorry, not LGTM. We don't have versioned docs, every page describes the API in all jQuery versions so we need to have all documented. See e.g. how the data page describes 3.0 behavior changes.

Could you try doing sth like that here?

@aried3r
Copy link
Contributor Author

aried3r commented Jul 8, 2016

Could you try doing sth like that here?

I didn't know how to handle the example properly because I couldn't find an example. Hope it's fine like this.

@AurelioDeRosa
Copy link
Member

I'd suggest to update the PR to have something like we have for delegate():

// jQuery 1.4.3+
$( elements ).delegate( selector, events, data, handler );
// jQuery 1.7+
$( elements ).on( events, selector, data, handler );

@aried3r
Copy link
Contributor Author

aried3r commented Jul 14, 2016

How about

// jQuery <3.0
var multipleValues = $( "#multiple" ).val() || [];
// jQuery 3.0+
var multipleValues = $( "#multiple" ).val()

jQuery 1.0+ isn't quite correct, since that would include 3 as well. What do you think?

@AurelioDeRosa
Copy link
Member

Yeah, it looks good to me.

@kswedberg
Copy link
Member

Closed by 5689f1a

@kswedberg kswedberg closed this Jul 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants