{"action":"closed","issue":{"url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/509","labels_url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/509/labels{/name}","comments_url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/509/comments","events_url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/509/events","html_url":"https://github.com/getify/You-Dont-Know-JS/issues/509","id":99880446,"number":509,"title":"Does browser based JS have any way to get data synchonously?","user":{"login":"govpack","id":8147200,"avatar_url":"https://avatars.githubusercontent.com/u/8147200?v=3","gravatar_id":"","url":"https://api.github.com/users/govpack","html_url":"https://github.com/govpack","followers_url":"https://api.github.com/users/govpack/followers","following_url":"https://api.github.com/users/govpack/following{/other_user}","gists_url":"https://api.github.com/users/govpack/gists{/gist_id}","starred_url":"https://api.github.com/users/govpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/govpack/subscriptions","organizations_url":"https://api.github.com/users/govpack/orgs","repos_url":"https://api.github.com/users/govpack/repos","events_url":"https://api.github.com/users/govpack/events{/privacy}","received_events_url":"https://api.github.com/users/govpack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/getify/You-Dont-Know-JS/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-09T09:51:32Z","updated_at":"2015-08-11T07:39:29Z","closed_at":"2015-08-11T07:39:29Z","body":"Recently this error warning has been showing up in chrome: \"Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.\"\r\n\r\nbecause \"Synchronous XMLHttpRequest outside of workers is in the process of being removed from the web platform.\"\r\n\r\nWhen the majority of task based programming (50-60 years of history) is  synchronous, there should be a way to simply Get/Set values without having to descend into callback hell.\r\n\r\nI have some variables i wish to retrieve in a browser based App the data is somewhere between 0 and 1ms away right there on the local disk...\r\n\r\nms=Date.now();\r\ndata=j.o('A.5.in|get|l');\r\nDate.now()-ms //  --> returns after a 0 or 1 millisecond delay\r\n\r\nI am quite happy to wait the 1 millisecond for the data to arrive!! since the data will be needed for the next step, i choose to wait and block, that is my desired use case, because it gives far greater simplicity for getting and consuming that data.  \r\n\r\nwe have been able to do this for years, by doing something as straightforward as:\r\nxhr=new XMLHttpRequest(); xhr.open('GET','../../../../data_file',false); xhr.responseText\r\n\r\nbut now some busy body at the whatwg.org wish to take back, reject, and BREAK 15 years of being able to read a bit of data directly!!! I don't want to make every variable into a function. The thing is I thought that was only deprecated?? the thing is async=false, flat out doesn't work anymore!!! \r\n\r\nSo my question is: Does browser based JS have any way to get data synchronously? or has some one chosen for us that we all have to swallow the red pill?"}}