mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
34 lines
964 B
HTML
34 lines
964 B
HTML
<!DOCTYPE html>
|
|
<!--
|
|
Copyright 2013 The Toolkitchen Authors. All rights reserved.
|
|
Use of this source code is governed by a BSD-style
|
|
license that can be found in the LICENSE file.
|
|
-->
|
|
<html>
|
|
<head>
|
|
<title>Jsonp</title>
|
|
<script src="../platform/platform.js"></script>
|
|
<script src="../toolkit.js"></script>
|
|
<link rel="import" href="../components/g-jsonp.html">
|
|
</head>
|
|
<body>
|
|
<g-jsonp url="https://clients1.google.com/finance/info?q=GOOG&client=ig&callback="></g-jsonp>
|
|
<template bind="{{stockquote}}">
|
|
<div>quote: {{l}}</div>
|
|
</template>
|
|
<script>
|
|
document.addEventListener('WebComponentsReady', function() {
|
|
var jsonp = document.querySelector("g-jsonp");
|
|
jsonp.addEventListener("response",
|
|
function(inEvent) {
|
|
var model = {
|
|
stockquote: inEvent.detail.response[0]
|
|
};
|
|
HTMLTemplateElement.bindTree(wrap(document.body), model)
|
|
}
|
|
);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|