0

I have a page made with WebComponents standard (mainly paper elements by Polymer) and I need get via AJAX an portion of HTML page.

When I append the HTML getted via AJAX to my page, don't render correctly.

How render HTML

In the image, can be apreciate, the paper-card heading="Dominio .com" is a paper-card that the HTML is getted via AJAX and appended to the page, but isn't getting the attributes that Polymer sets automatically and in page, the paper card isn't rendered correctly.

How render WebView

I transform the HTML getted via AJAX with this method.

Ivan Montilla
  • 392
  • 4
  • 19
  • due to security reasons it is not possible to insert custom elements getted from ajax. The link you provided has some workarounds but it's still bad approach :/ i tried to find relevant articles on stackoverflow or github, but unfrotunately i can't find any – Kuba Šimonovský May 29 '17 at 11:54

1 Answers1

0

Yes, you can do that - use importHref.

https://www.polymer-project.org/1.0/docs/api/Polymer.Base#method-importHref

It will dynamicaly fetch and register an element for you.

Ergo
  • 1,205
  • 9
  • 16