JavaScript runtime error: Object doesn't support property or method 'registerElement'
in File: ... bower_ponents\polymer\polymer.js Line 11701
document.registerElement('polymer-element', {prototype: prototype});
My Bower:
{
"name": "Polymer",
"version": "0.0.0",
"main": "main",
"license": "MIT",
"private": true,
"dependencies": {
"polymer": "Polymer/polymer#~0.5.2",
"core-icons": "Polymer/core-icons#~0.5.2",
"core-elements": "Polymer/core-elements#~0.5.2",
"paper-elements": "Polymer/paper-elements#~0.5.2"
}
}
And my page:
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="/client/polymer-0.5.2/bower_ponents/polymer/polymer.html">
</head>
<body>
<!-- render data set -->
<template id="auto-bind-demo" is="auto-binding" repeat="{{quotes}}">
<div on-tap="{{quoteClicked}}">
<h3>{{quote}}</h3>
- <em>{{attribution}}</em>
</div>
</template>
<script>
var t = document.querySelector('#auto-bind-demo');
t.quoteClicked = function() {
alert('Quote clicked!');
};
t.quotes = [{
attribution: 'Plautus',
quote: 'Let deeds match words.'
}, {
attribution: 'Groucho Marx',
quote: 'Time flies like an arrow. Fruit flies like a banana.'
}];
</script>
</body>
</html>
What's wrong? I took this from the example in the documentation. Here .html#autobinding
PS: Browser IE11
JavaScript runtime error: Object doesn't support property or method 'registerElement'
in File: ... bower_ponents\polymer\polymer.js Line 11701
document.registerElement('polymer-element', {prototype: prototype});
My Bower:
{
"name": "Polymer",
"version": "0.0.0",
"main": "main",
"license": "MIT",
"private": true,
"dependencies": {
"polymer": "Polymer/polymer#~0.5.2",
"core-icons": "Polymer/core-icons#~0.5.2",
"core-elements": "Polymer/core-elements#~0.5.2",
"paper-elements": "Polymer/paper-elements#~0.5.2"
}
}
And my page:
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="/client/polymer-0.5.2/bower_ponents/polymer/polymer.html">
</head>
<body>
<!-- render data set -->
<template id="auto-bind-demo" is="auto-binding" repeat="{{quotes}}">
<div on-tap="{{quoteClicked}}">
<h3>{{quote}}</h3>
- <em>{{attribution}}</em>
</div>
</template>
<script>
var t = document.querySelector('#auto-bind-demo');
t.quoteClicked = function() {
alert('Quote clicked!');
};
t.quotes = [{
attribution: 'Plautus',
quote: 'Let deeds match words.'
}, {
attribution: 'Groucho Marx',
quote: 'Time flies like an arrow. Fruit flies like a banana.'
}];
</script>
</body>
</html>
What's wrong? I took this from the example in the documentation. Here https://www.polymer-project/docs/polymer/databinding-advanced.html#autobinding
PS: Browser IE11
Share asked Jan 3, 2015 at 3:13 nimnim 3281 gold badge5 silver badges16 bronze badges1 Answer
Reset to default 6Currently only Chrome and other blink-based browsers support Custom Elements. Firefox supports but not enabled by defualt.
See Can I Use for a full supporting chart.
If you are using it on other browsers, you need to include a Web Components polyfill (usually a file named webponents.js).
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744810168a4595009.html
评论列表(0条)