Skip to content

Instantly share code, notes, and snippets.

@ToJans
Created April 6, 2015 15:16
Show Gist options
  • Save ToJans/27c525977aefb04923b5 to your computer and use it in GitHub Desktop.
Save ToJans/27c525977aefb04923b5 to your computer and use it in GitHub Desktop.
I don't understand why something this simple doesn't work (I get back undefined is not a function)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Editor</title>
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<link rel="import" href="elements/user-gravatar.html" />
</head>
<body>
<user-gravatar email="[email protected]"/>
</body>
</html>
<link rel="import" href="bower_components/polymer/polymer.html">
<polymer-element name="user-gravatar" attributes="email">
<template>
<img src="https://secure.gravatar.com/avatar/{{gid}}" />
</template>
<script>
Polymer('user-gravatar', {
ready: function() {
this.gid = md5(this.email);
}
});
</script>
</polymer-element>
@AVGP
Copy link

AVGP commented Apr 6, 2015

Where does the md5() function come from? I guess that's the one that gives an "undefined is not a function"?

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