Skip to content

Instantly share code, notes, and snippets.

@ryanseddon
Created May 25, 2011 07:07
Show Gist options
  • Save ryanseddon/990489 to your computer and use it in GitHub Desktop.
Save ryanseddon/990489 to your computer and use it in GitHub Desktop.
Marqeeeeeeeeeeeeeeeeeeeeeeee
// Because the world needs more marquee's
if(!''.marquee) {
String.prototype.marquee = function() {
return '<marquee>' + this + '</marquee>';
}
}
"OMG".marquee();
@bernhard-hofmann
Copy link

I get "undefined" in Chrome 13.0.772.0 dev-m

@mathiasbynens
Copy link

Should be this, not the str argument.

Also, you could simplify the if check to if (!''.marquee).

if (!''.marquee) {
    String.prototype.marquee = function() {
        return '<marquee>' + this + '</marquee>';
    }
}

@ryanseddon
Copy link
Author

thanks @mathiasbynens you've fixed my stupidity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment