Skip to content

ajax: post and get accept config object [issue #1986] #1995

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 4 commits into from

Conversation

togakangaroo
Copy link
Contributor

See this issue for more discussion.

@dmethvin
Copy link
Member

dmethvin commented Jan 6, 2015

I love it when someone delivers. 🌟

url: url,
type: method,
dataType: type,
data: data,
success: callback
});
}, (jQuery.isPlainObject(url) && url)));
Copy link
Member

Choose a reason for hiding this comment

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

Should be spaces inside the parens here per our style guide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trying to find it in the style guide...you mean it should be ( jQuery.isPlainObject(url) && url )))?

Copy link
Member

Choose a reason for hiding this comment

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

Although this allows a mixed call like $.ajax({ options }, data) I think we'd only want to document a single options object.

Copy link
Member

Choose a reason for hiding this comment

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

( jQuery.isPlainObject( url ) && url ) ) )

Copy link
Member

Choose a reason for hiding this comment

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

The outer parens aren't needed tho, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I don't think they're needed, just make it clearer that its a single expression. I'll remove. Agree about only documenting a single options object

@dmethvin
Copy link
Member

dmethvin commented Jan 6, 2015

@togakangaroo
Copy link
Contributor Author

@dmethvin I signed it, thanks

@togakangaroo
Copy link
Contributor Author

I'm not super sure where/how to update the docs btw. Really mostly where

@@ -2034,6 +2034,25 @@ module( "ajax", {
});
});

asyncTest( "jQuery[get|post]( config ) - simple with xml", 2, function() {
jQuery.when.apply(jQuery,
Copy link
Member

Choose a reason for hiding this comment

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

The same remark about spaces; there should be a space after (, [ and before ), ] etc.

@dmethvin
Copy link
Member

dmethvin commented Jan 6, 2015

I created jquery/api.jquery.com#620 , The docs are at http://github.com/jquery/api.jquery.com/#readme, they're processed from XML so you'll want to go through the setup listed there or pull down the preconfigured VM so that you can be sure the markup looks good.

dmethvin pushed a commit that referenced this pull request Jan 12, 2015
@dmethvin dmethvin closed this in 89ce0af Jan 12, 2015
markelog pushed a commit that referenced this pull request Nov 10, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants