Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

removed $ object. #60

Merged
merged 2 commits into from

2 participants

@swdyh

It causes the ReferenceError in the environment without jQuery like Node.js.

@keitaf keitaf merged commit 66b07dd into twitter:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 14, 2012
  1. @swdyh

    removed $ object.

    swdyh authored
  2. @swdyh

    added hasOwnProperty check.

    swdyh authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +5 −3 twitter-text.js
View
8 twitter-text.js
@@ -497,9 +497,11 @@ if (typeof twttr === "undefined" || twttr === null) {
precedingEllipsis: displayUrl.match(/^/) ? "" : "",
followingEllipsis: displayUrl.match(/$/) ? "" : ""
};
- $.each(v, function(index, value) {
- v[index] = twttr.txt.htmlEscape(value);
- });
+ for (var k in v) {
+ if (v.hasOwnProperty(k)) {
+ v[k] = twttr.txt.htmlEscape(v[k]);
+ }
+ }
// As an example: The user tweets "hi http://longdomainname.com/foo"
// This gets shortened to "hi http://t.co/xyzabc", with display_url = "…nname.com/foo"
// This will get rendered as:
Something went wrong with that request. Please try again.