oskarkrawczyk / heyoffline Goto Github PK
View Code? Open in Web Editor NEWWarn your users when their network goes down. Make sure they don't lose anything.
Warn your users when their network goes down. Make sure they don't lose anything.
Forgot to add @ symbol, 676f702
The script doesn't work on Mozilla Firefox 29.0.1 (Windows 7).
But works fine on the same machine with -
Google Chrome 35.0.1916.153 m
Opera 22.0.1471.70
Internet Explorer 11.0.9600
It doesn't work on Webkit browser but it works on Firefox Mobile
This project is just awesome !
But there's a thing that embarrass me, it's not possible to check the network when the website opens.
I would be usefull if the website is available offline (thanks to the HTML5 manifest).
I just want to say this is really useful for me. I am creating a web text editor and want to tell users if they can save. If it is alright I would like to build on this API.
Please see the code below, the output of console.log shows that onOnline and onOffline events are the opposite of network availability. (meaning that onOnline triggered when disconnected from the wifi, and onOffline triggered when reconnected to wifi)
The modal window show and hide are correct.
$(function () {
new Heyoffline({
onOnline: function () {
console.log("online now");
},
onOffline: function () {
console.log("offline now");
}
});
});
please advise,
Thank you,
setInterval
+ async request would probably be the way to go with this.
I switched my Wi fi off for about 60 seconds. But then I did not see any DOM change to reflect the functioning of your online demo script. Is there anything more I need to do?
Thanks. Great project btw.
I am trying to change the texts of the heyoffline script. Unfortunately, i'm not being able to change it's options, like such:
new Heyoffline({
text: {
title: "Heading",
content: "WarningMessage",
button: "Close Alert"
}
});
It tells me that "object is not a function". My console is telling me that "Heyoffline" is an object, not a function.
Without any adjustments, if I disconnect my wifi, it displays your heyoffline popup just fine.
Any clue what I am missing here?
TIA, Jasper
I can't figure out how to change the text. I've tried with the following code
new Heyoffline({
text.title: "Heading",
text.content: "Warning Text",
text.button: "Close Warning"
} ) ;
But I just get some error messages. Uncaught SyntaxError: Unexpected token .
What could be wrong?
"Object doesn't support this property or method"
Would be useful to update the readme to have a list of supported browsers or, alternately, a description of what features are required for this to work.
My first impression of this was that it did not work because I tried the demo in Firefox 19.0.2 (which does not support the features required by this utility).
Hey there. Great little script - works fine in Chromium under Ubuntu, but doesnt in Firefox. Also fails in a Windows 7 virtualbox under Safari and Firefox, havent tested Chrome yet. Just an FYI, hope to see improvements in the future!
I tested this by disconnection my network connection while on the demo site and it didn't detect I had lost my connection.
So is this script only for mobile devices? Or for when the browser is set to Work Offline ?
Tested on Firefox 17.0.
I undestand that firefox spec is not standard regarding the online/offline events. But it should trigger at least when the user clicks on "work offline" which is not the case currently.
Thanks.
How to load Heyoffline using require.js
I connect to the Internet via ssh proxy tunnel. If I disable the proxy tunnel message won't appear (it'll appear only when I disconnect from Wi-Fi).
Mac OS X 10.8.2
A conditional would be useful to check at any point in a script if the client/browser is offline or online.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.