最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Failed to load resource: net::ERR_EMPTY_RESPONSE http:test.com - Stack Overflow

programmeradmin1浏览0评论

Im working on a chrome extension which sends XMLHttpRequest to a URL, gets response in JSON format, parse the response and shows list of records. Its working fine. The problem is when user performs any action and go back to listing section, system follows the same process sends the XMLHttpRequest request but everytime i get this response:

Failed to load resource: net::ERR_EMPTY_RESPONSE 

First time when i load the extension everything works fine, after that it always show the above mentioned error.

Its a two HTML pages extension. One for signin and other for listing. Im using ajax to toggle divs based on results.

Now the Weird part. Only 3 of my users have this problem so far. Two of them have mac and one windows 8.1. For all other users it works perfectly fine.

Im working on a chrome extension which sends XMLHttpRequest to a URL, gets response in JSON format, parse the response and shows list of records. Its working fine. The problem is when user performs any action and go back to listing section, system follows the same process sends the XMLHttpRequest request but everytime i get this response:

Failed to load resource: net::ERR_EMPTY_RESPONSE http://test.

First time when i load the extension everything works fine, after that it always show the above mentioned error.

Its a two HTML pages extension. One for signin and other for listing. Im using ajax to toggle divs based on results.

Now the Weird part. Only 3 of my users have this problem so far. Two of them have mac and one windows 8.1. For all other users it works perfectly fine.

Share Improve this question edited Mar 13, 2014 at 16:11 Kevin asked Mar 13, 2014 at 9:34 KevinKevin 7792 gold badges10 silver badges27 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

I have run across the same problem. I developed a very AJAX intensive application, which works perfectly on the localhost. Using the identical machine to test the live site (hosted by GoDaddy) pressing a button to activate an AJAX function is intermittently accepted.

If I repeatedly press the button, and watch what is going on in the developer tools, I see the Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. indicated by the "(failed)":

On the eighth attempt in the above picture, you can see it finally worked. The best way to verify if this is what is happening to you is to wait 1 minute, and repeat the action. It seems that the speed of the connection is what is causing this problem, although the speed of the last error is much faster than the first success. And while I am checking other websites to verify that the internet is still "ON", this might do more with the settings in the web-browser, or the host puter. You can see that this seems to be the solution to the problem, according to this answer. But then again, this answer states to reset the network settings and restart the machine.

Other solutions point to clearing the browser's cache or disabling add-ons, but reloading or refreshing is difficult and unreliable as a solution for non-tech users. Finally, it might have something to do with the hosting server settings.

I suspect it may have something to do with the Server sensing a DDOS attack (a large number of small AJAX requests), so it temporarily blocks/ignores the request. Changing hosts (or self hosting) may be the best solution.

This is quite simple, when chosen your domain. do not chose multiple domain. Just chose a single domain during the setup wizard and you are good to go. #TG

发布评论

评论列表(0)

  1. 暂无评论
ok 不同模板 switch ($forum['model']) { /*case '0': include _include(APP_PATH . 'view/htm/read.htm'); break;*/ default: include _include(theme_load('read', $fid)); break; } } break; case '10': // 主题外链 / thread external link http_location(htmlspecialchars_decode(trim($thread['description']))); break; case '11': // 单页 / single page $attachlist = array(); $imagelist = array(); $thread['filelist'] = array(); $threadlist = NULL; $thread['files'] > 0 and list($attachlist, $imagelist, $thread['filelist']) = well_attach_find_by_tid($tid); $data = data_read_cache($tid); empty($data) and message(-1, lang('data_malformation')); $tidlist = $forum['threads'] ? page_find_by_fid($fid, $page, $pagesize) : NULL; if ($tidlist) { $tidarr = arrlist_values($tidlist, 'tid'); $threadlist = well_thread_find($tidarr, $pagesize); // 按之前tidlist排序 $threadlist = array2_sort_key($threadlist, $tidlist, 'tid'); } $allowpost = forum_access_user($fid, $gid, 'allowpost'); $allowupdate = forum_access_mod($fid, $gid, 'allowupdate'); $allowdelete = forum_access_mod($fid, $gid, 'allowdelete'); $access = array('allowpost' => $allowpost, 'allowupdate' => $allowupdate, 'allowdelete' => $allowdelete); $header['title'] = $thread['subject']; $header['mobile_link'] = $thread['url']; $header['keywords'] = $thread['keyword'] ? $thread['keyword'] : $thread['subject']; $header['description'] = $thread['description'] ? $thread['description'] : $thread['brief']; $_SESSION['fid'] = $fid; if ($ajax) { empty($conf['api_on']) and message(0, lang('closed')); $apilist['header'] = $header; $apilist['extra'] = $extra; $apilist['access'] = $access; $apilist['thread'] = well_thread_safe_info($thread); $apilist['thread_data'] = $data; $apilist['forum'] = $forum; $apilist['imagelist'] = $imagelist; $apilist['filelist'] = $thread['filelist']; $apilist['threadlist'] = $threadlist; message(0, $apilist); } else { include _include(theme_load('single_page', $fid)); } break; default: message(-1, lang('data_malformation')); break; } ?>