« first day (2815 days earlier)      last day (2355 days later) » 

02:11
@ShrekOverflow maybe some other time
 
3 hours later…
05:36
@towc (fielding.length !== 0) works fine thanks :)
 
4 hours later…
09:41
hi, guyz can anyone please tell me why jqery script does not rander of a page, when that page is rendered by ng-view of angular??
    function isAlive(status){
        // only "Success" requests are okay
        // redirection URLs may die anytime, need to log them too
        return 200 <= status < 300;
    }

    function test(callback){
        var xhr = new XMLHttpRequest();
        xhr.open("GET", URL);
        xhr.onload = function(event){
            var status = this.status;
            console.log(status, isAlive(status));
        };
        xhr.send();
    }

    test();
Hey all, I am writing a userscript to test if a given general URL is alive or not. I checked for several web services, but none of them have a free API. (if you find one, please tell!) So I wrote the above code myself.

The only thing I am worried about is its efficiency. For example, what if the URL was a link to a 250 page PDF. It would only fire the `onload` event once the entire pdf has loaded, even though I only wish to check if the PDF _exists_. I am not concerned with the contents of the pdf, but I believe this GET request would fetch that whole pdf. So, my question is how to improve
10:16
        xhr.onreadystatechange = function(event){
            var status = this.status;

            if(this.readyState >= 2){
                console.log(status, isAlive(status));
                console.log(this);
                // no need to waste bandwidth further
                xhr.abort();
            }
        };
@GaurangTandon Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
I made an improvement by using the onreadystatechange, since i noticed that the status property is set as soon as response headers are received. Is this improvement sufficient, or are there more ways that I could utilize?
10:43
CORS is causing me trouble. I am unable to disable it in chrome using the method described, as it just suppresses the error and still returns status=0. For example, setting URL=https://www.google.com messes it up. Could anyone help me resolve this? I am running the script in the DevTools tab of the new tab page of Chrome
 
1 hour later…
12:07
// MVCE
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://google.com");
xhr.send();
I've been trying for over two hours without success. The above code does not work, no matter if I change the URL, add extensions like "CORS toggle", open Chrome with flags, etc. What is wrong here? Please help
12:26
what isn't working?
does the request not fire?
 
6 hours later…
18:42
Hey all. Anyone here good with PWA serviceWorker?
Hello
 
1 hour later…
19:58
Is there a way to clear out the bytes from a Float32Array in order to reuse it and push new values into it?
Trying to cut down on some GC
.fill(0) ?
 
1 hour later…
21:16
all of a sudden the css properties in my chrome dev tools inspector are not editable
usually i can double click them and type in values.
hmm looks like its the styling sets that say "inherited from .." that are not editable
22:04
1 message moved to Trash can
@JBis Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
var source = new EventSource("demo_sse.php");
source.onmessage = function(event) {
    document.getElementById("result").innerHTML += event.data + "<br>";
};
Can the demo_see.php be changed?
With JavaScript?
Like source.location = "demo_see.php?foo=bar";

« first day (2815 days earlier)      last day (2355 days later) »