Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer doesn't work in IE or edge but in chrome it does, however with a Doctype it doesn't work in chrome either

I am having some trouble with my polymer project, my code doesn't work in IE, Edge and not even in chrome if I include <!doctype html>. Here's my code:

<!doctype html>
<html>
  <head>
    <link rel="import" href="bower_components/paper-header-panel/paper-header-panel.html">
    <link rel="import" href="bower_components/paper-card/paper-card.html">
    <LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
    <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
    <link rel="import" href="bower_components/polymer/polymer.html">
  </head>
  <body>
    <paper-header-panel mode="standard" id>
      <paper-toolbar  style="background-color: some-color">
        <h1>Blah</h1>
      </paper-toolbar>
      <div id="content">
      <div class="center2">
        <h3>Blah Blah Blah<span id="orange">Blah Blah Blah</span></h3>
      </div>
      <paper-card heading="Blah Blah Blah" id="main">
        <div class="card-content">
        </div>
      </paper-card>
      <paper-card heading="Blah Blah Blah" id="main">
        <div class="card-content">
          <img src="img.png" height="200px" id="img"/>
          </br>
          Blah Blah Blah
        </div>
      </paper-card>
      </div>
    </paper-header-panel>
  </body>
</html>

Any help will be valued. Thank You!

like image 805
Peter Warrington Avatar asked Dec 01 '15 17:12

Peter Warrington


1 Answers

You need the polyfill to work in non chrome browsers. I didn't think you did in chrome, but maybe you still do until the next release.

put

<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>

in the header before you start to import any other stuff

like image 103
akc42 Avatar answered Oct 16 '22 13:10

akc42