Comments (10)
How are you trying to use the module?
from grade.
I'm actually trying to use it with Wordpress. I've renamed the resource .js file to grade.js
Enqueued the file in the header (which shouldn't be an issue, seeing as other .js files run fine).
I've then added this (before the opening footer tag):
<script type="text/javascript"> window.addEventListener('load', function(){ /* A NodeList of all your image containers (Or a single Node). The library will locate an <img /> within each container to create the gradient from. */ Grade(document.querySelectorAll('.thumbnail_grad')) }) </script>
This results in the aforementioned error and just ends up not working.
Let me add that js hint (Atom) - also outputs a bunch of errors (most of them following this example):
"W104 - 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).at line 1 col 1"
from grade.
You're going to want to compile it for browser usage, not rename it.
babel src/index.js --out-file grade.js
from grade.
Hey Daniel,
From the README:
Download this repo and grab the grade.js file from the /docs/dist folder.
So you shouldn't need to compile anything, just copy that file into your project and reference it from a script tag,
Hope this helps
from grade.
@benhowdle89 @nijikokun Thanks for the help - will try again and let you know how it goes.
Only issue that I may have however, is that the index.html file is the docs folder results in the following:
http://www.awesomescreenshot.com/image/1504079/927134018a4ee807d78acd196ed720ac
In other words - I don't think it works in the example provided in the download folder.
from grade.
you're probably seeing the same problem as issue #5
from grade.
Does this require a web server to work? I'll test it out and report back.
from grade.
I can confirm that it works with wamp - launched from a server, rather than desktop.
from grade.
Excellent, glad you got it working!
from grade.
@benhowdle89 Just a quick question, why don't you compile a transpiled module before deploying to npm and just set "main": "lib/index.js"
? Then you wouldn't need to have babel when using the package.
from grade.
Related Issues (17)
- Not working in Safari HOT 1
- Work as a util server side. HOT 4
- Missing license HOT 1
- OSX Google Chrome - SecurityError HOT 4
- Flash of Unstyled DIVs HOT 3
- [REQUEST] CDN HOT 1
- Canva tainted by cross-origin data on Chrome HOT 1
- Request: ability to get just colors HOT 4
- Suggestion: Generate recommended text color HOT 2
- Images with Same name but different dir will render same bg color
- SecurityError: The operation is insecure.
- The link in the project description doesnโt work HOT 2
- I built a website for this awesome tool
- Working only with the saved images HOT 1
- gradientData Array Empty on different webserver HOT 1
- Add typescript definitions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grade.