OK ..我已經配置Polymer Project,因爲它是在This Video無法運行一個簡單的應用聚合物
項目結構是:
我的自定義要素是:
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="hello-world" noscript>
<template>
<h1>Hi From Custom Element</h1>
</template>
</polymer-element>
index.html是:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<script type="text/javascript" src="bower_components/polymer/polymer.js">
</script>
<link rel="import" href="elements/hello-world.html">
</head>
<body>
<hello-world></hello-world>
</body>
</html>
OK。當我沒有服務器運行此代碼,我得到錯誤:
Imported resource from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Received an invalid response. Origin 'null' is therefore not allowed access.
,當我在WAMP運行應用程序,我得到錯誤:
在polymer.js在這種情況下的任何幫助?
'Polymer.js'是聚合物庫,使用Web組件,這是不需要爲了應用程序的工作。加載webcomponents.js這是Web組件的Polyfill。 – Adi 2015-02-23 09:26:12