Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How are you getting around same-origin-policy issues with this script? I noticed the javascript debugger is reporting failures for every request: "Origin http://www.cloudping.info is not allowed by Access-Control-Allow-Origin.". Are you just counting on the request failing, but recording the time that it takes to do so anyway?


I'm using jQuery's ajax() function to make the request. The same origin policy prevents the script from receiving the data returned by the request or even seeing whether it succeeded or not. But timing is not hidden, so I can see how long the request takes.

Personally, I think JavaScript in the browser is a really ugly way to program. What could have been a simple loop or tail-recursive iteration over a list ended up requiring three continuations.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: