Skip to content

Fixed broken example in .index() #60

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

Merged
merged 1 commit into from
Oct 14, 2012
Merged

Conversation

easternbloc
Copy link
Contributor

Very simple fix. One of the examples was missing a closing parentheses.

@@ -68,7 +68,7 @@ alert('Index: ' + listItem.index('li'));
<span class="output">Index: 1</span>
</p>
<p>If we omit the argument, <code>.index()</code> will return the position of the first element within the set of matched elements in relation to its siblings:</p>
<pre><code>alert('Index: ' + $('#bar').index();</code></pre>
<pre><code>alert('Index: ' + $('#bar').index());</code></pre>
Copy link
Member

Choose a reason for hiding this comment

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

Should we be using alert() at all in the documentation examples?

@easternbloc
Copy link
Contributor Author

Probably not but a quick grep reveals 39 uses of console.log and 193 uses of alert :)

@rwaldron
Copy link
Member

rwaldron commented Sep 3, 2012

Unfortunately, alert is ubiquitous, whereas we just wish console.log was :/

@easternbloc
Copy link
Contributor Author

This is true. I'll leave this with you guys. Thanks.

kswedberg added a commit that referenced this pull request Oct 14, 2012
Fix broken example in .index(). 

Thanks @easternbloc. 

We can revisit the merits of using something other than alert() another time.
@kswedberg kswedberg merged commit 8ae3e01 into jquery:master Oct 14, 2012
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.

4 participants