Comments (6)
This was being discussed in pull request #10. The request was to add a DOM loaded event, which I'm still not sure is the right approach for this project since most people already have a library to do this (e.g. jQuery)...
I was thinking of 2 options (code examples are just for visual purposes):
- expose the init method in the API meaning it would have to be initiated before use
// initialize after DOM ready
alertify.init();
// use
alertify.alert("...");
- check the first time alertify is used to see if it's already been initialized. That way it doesn't change the current usage but prevents alertify from trying to create DOM elements before it's told to.
// maybe in the dialog method
if (typeof init === "function") init();
// and have the init method delete itself after first use
init = function () {
...
delete this.init;
}
I'd love to get some input on it.
from alertify.js.
Just as an aside, you may want to consider making the body requirement a little more apparent in the docs. Although I was able to figure this out fairly quickly, specifically when I saw n.body is null, it was not immediately clear that alertify.js needs to be in the body. But otherwise implementing it was a breeze.
To your point above, I like that it's not put into the DOM until I need it. On the page where I use it, I'm already relying on the client to parse a good deal of code and determine the layout, so for me at least, this is a great feature.
from alertify.js.
Documentation updates are a priority this weekend - mainly around usage, code contribution guidelines ...
from alertify.js.
Looking forward to this fix since Ruby On Rails automatically includes javascript in the <head>
from alertify.js.
Fixed with ^ pull request
from alertify.js.
hi Fabien,
this fixed my problem. thank you!!
vera
from alertify.js.
Related Issues (20)
- Can you add timeout function for confirmation and alert too? HOT 1
- Button focus error.
- Change Button Colour Dynamically / Multiple Buttons HOT 1
- Add main file in package.json HOT 1
- Since alertify is no longer maintained, consider jAlert HOT 9
- Alertify confirms and submits a form automatically without clicking OK. HOT 1
- can i use alertify in react HOT 2
- Prevent Duplicates HOT 2
- Notifications in background
- Missing default bootstrap skin without theme
- Does it supports on IE9 and below HOT 1
- How to enable alert and prompt at same time
- not working with firefox HOT 3
- How can I add an checkbox to promt and catch result? HOT 1
- issue with alertify I want display outside the iframe onClicking button
- how can i change the date formatting by using jqury
- Confirm popup not wotking for mobile device
- a href tag
- prevent close on enter
- Alertify Confirm Automatically Refresh Page HOT 2
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 alertify.js.