Git Product home page Git Product logo

elm-box's People

Contributors

pdamoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

elm-box's Issues

Error while running examples in Safari and Firefox

The error occurs in Safari 10.0.2 or 10.2 (Technology preview version) or Firefox 50.1.0.

The error appears in every example. In this case RandomGif.elm:

TypeError: document.registerElement is not a function[Learn More]  RandomGif.elm:13156:3
	define http://localhost:8000/_compile/RandomGif.elm:13156:3
	<anonymous> http://localhost:8000/_compile/RandomGif.elm:13434:37
	<anonymous> http://localhost:8000/_compile/RandomGif.elm:2:2
TypeError: runElmProgram is not a function[Learn More]  RandomGif.elm:10:1
	<anonymous> http://localhost:8000/RandomGif.elm:10:1

The part where the error occurs is the document.registerElement function in this part of the code:

// REGISTERS THE COMPONENT
var css = Object.create(null);

function loadCSS(document, css) {    
  var style = document.createElement('style');
    style.type  = 'text/css';
    style.textContent  = css;
    document.head.insertBefore(style, document.head.lastChild);
}

function define(impl){
  var proto = Object.create(HTMLElement.prototype);

  proto.createdCallback = function(){
    initializeWC(this, impl); 
    if (!(impl.name in css)){
      loadCSS(this.ownerDocument || document, impl.css);
      css[impl.name] = true 
    };
  };


  proto.attributeChangedCallback = function (name, prev, curr) {
    this.send(name, curr);
  };
  
  document.registerElement(impl.name, { prototype:proto });

Which seems to be line 162 in box.js.

Only in Chrome the examples work just fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.