Kills all JS if not all ID's are available in document
See original GitHub issueHello! First of all: I love vivus.js, thank you. I’m new to JS, and I ran into a problem with the setup. vivus.js is part of my global script.min.js. when all ID’s are available in the html document, everything works great. but when only a single ID that is requested by the instance is missing, or if none are available, it kills all javascript on the website. what am I missing? thank you very much.
Vivus Version: v0.4.2 Safari Browser: 11.0
index.html (no ID, kills all js)
<body>
<div>
Content
</div>
<script src="/js/script.min.js"></script>
</body>
example.html (not all IDs, kills all js)
<body>
<div>
<svg id="mysvg1">
</svg>
</div>
<script src="/js/script.min.js"></script>
</body>
example2.html (all IDs, all js works)
<body>
<div>
<svg id="mysvg1">
</svg>
<div>
</div>
<svg id="mysvg2">
</svg>
</div>
<script src="/js/script.min.js"></script>
</body>
Set up
new Vivus('mysvg1', {duration: 200}, myCallback);
new Vivus('mysvg2', {duration: 200}, myCallback);
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Select all elements that don't start with a certain id
javascript - Select all elements that don't start with a certain id - Stack Overflow. Stack Overflow for Teams – Start collaborating and ......
Read more >Backbone.js
Removes all attributes from the model, including the id attribute. Fires a "change" event unless silent is passed as an option. id model.id...
Read more >Node.js v19.3.0 Documentation
Every .html document has a corresponding .json document. This is for IDEs and other utilities that consume the documentation.
Read more >CDE :: Home
The FBI's Crime Data Explorer (CDE) aims to provide transparency, create easier access, and expand awareness of criminal, and noncriminal, law enforcement data ......
Read more >Stripe JS Reference
This reference documents every object and method available in Stripe's browser-side JavaScript ... The form will render with empty fields if not provided....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As I said before, if the ID doesn’t exist, it will trigger an error.
So for each of your instances I would suggest you to test is the ID is available before running the code.
Also, make sure that
myCallback
exists if you plan to use it.All güüd then 😃