Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make it work #25

Open
leiamac opened this issue Apr 29, 2015 · 4 comments
Open

Can't make it work #25

leiamac opened this issue Apr 29, 2015 · 4 comments

Comments

@leiamac
Copy link

leiamac commented Apr 29, 2015

I have put the scripts in their respective places but for some reason it doesn't work. I loaded the demo in Safari 5.0 for windows and it worked, I don't know what I'm doing wrong. The script files are in the same directory as index.html. Any help would be really appreciated :)
Please forgive me if it's a stupid question put it's the first time that i'm implementing a polyfill.

<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div id="test"></div>
<script type="text/javascript">
    if (!Array.prototype.filter)
    {
      Array.prototype.filter = function(fun /*, thisp*/)
      {
        var len = this.length;
        if (typeof fun != "function")
          throw new TypeError();
        var res = new Array();
        var thisp = arguments[1];
        for (var i = 0; i < len; i++)
        {
          if (i in this)
          {
            var val = this[i]; // in case fun mutates this
            if (fun.call(thisp, val, i, this))
              res.push(val);
          }
        }
        return res;
      };
    }
  </script>
  <script src="tokenizer.js"></script>
  <script src="parser.js"></script>
  <script src="vminpoly.js"></script>
</body>
</html>
#test {
    width: 10vw;
    height: 10vh;
    background-color: red;
}
@Ctsavas
Copy link

Ctsavas commented Aug 25, 2015

I also can't make it work in ie 8. I tried variations of including files from the responsive demo (http://saabi.github.io/vminpoly/demo2.html) or the main git page (https://github.com/saabi/vminpoly) but it didn't work. Also I added the console.log fix script as suggested here:(#16)

@ghost
Copy link

ghost commented Mar 13, 2016

Are you two still having issues getting this to work?
I just managed copying the simple demo and it looks beautiful in IE8.
Have you tried copying the simple demo exactly as it is?
Having the console.log fix for IE is wise.
Regarding tokenizer and parser I have used the exact same source of those as they are found in the demo instead of using a newer version from their repos.
Perhaps that is where the error is?
Let me know if you are still having problems and I will try to help to my best knowledge.

@leiamac
Copy link
Author

leiamac commented Mar 29, 2016

I couldn't make it work. Let me try it again and if a have the same problem I'll let you know.
Thank you!

@Arthur-W-White
Copy link

Were you able to get it working with Safari? I don't see how IE8 has anything to do with Safari. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants