相关疑难解决方法(0)

Chrome开发者工具中的资源平均值=取消了什么状态?

什么会导致页面被取消?我有Chrome开发者工具的屏幕截图.

取消资源

这经常发生但不是每次都发生.似乎一旦其他资源被缓存,页面刷新将加载LeftPane.aspx.真正奇怪的是,这只发生在谷歌浏览器,而不是Internet Explorer 8.任何想法为什么Chrome会取消请求?

debugging google-chrome http developer-tools web-developer-toolbar

370
推荐指数
10
解决办法
21万
查看次数

PHP Jquery Ajax调用抛出net :: ERR_EMPTY_RESPONSE

我在页面中有以下JavaScript代码.当进行ajax调用时,我可以看到浏览器inspect/debugger部分抛出net :: ERR_EMPTY_RESPONSE错误.它在localhost环境中工作正常,但在生产中抛出错误.

在客户端代码中,

<script>
$(document).ready(function(){
    $("#identityLinks a").on("click", function(){
    value = $(this).attr("id");
    if(value != "")
    {
        $.ajax({
            url:  "publish/updateUsersData.php",
            type: "POST",
            data: {receiverId: value},
            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
            dataType: "json",
            success: function(data) {
              //alert(data["result"]);
              console.log(data["result"]);
            },
            error: function(xhr, textStatus, errorThrown) {
               //alert(xhr +" "+ textStatus +" "+errorThrown);
               console.log(xhr +" "+ textStatus);
            }
        });
    }
    });
</script>
Run Code Online (Sandbox Code Playgroud)

在服务器端代码(PHP)中,我在updateUsersData.php中有以下代码:

<?php
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 01 Jan 1996 00:00:00 GMT');
header('Content-type: application/json; charset=UTF-8');
if(isset($_POST["receiverId"]))
{
    $receiver_id = trim($_POST["receiverId"]);
    $arr …
Run Code Online (Sandbox Code Playgroud)

php ajax jquery google-chrome

27
推荐指数
1
解决办法
3万
查看次数

如何在Google Chrome DevTools中看到身份验证标题?

标题基本上都说明了一切.我转到网络选项卡并转到"请求标头",但我没有发送我的身份验证.

在此输入图像描述

authentication google-chrome

11
推荐指数
0
解决办法
487
查看次数

Chrome阻止请求

我在Chrome中遇到了异常问题.它阻止了一些请求并返回以下内容:

min.php?g = oxp-js&v = 2.8.11/openx/www/admin/assets GET(失败)dashboard.php:29解析器

进一步调查后说:

显示Chrome临时标头

同一页面在其他浏览器上运行正常.

响应标题如下

Request URL:http://localhost/openx/www/admin/assets/min.php?g=oxp-css-ltr&v=2.8.11
Request Headers CAUTION: Provisional headers are shown.
Accept:text/css,*/*;q=0.1
Cache-Control:no-cache
Pragma:no-cache
Referer:http://localhost/openx/www/admin/dashboard.php
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.41 Safari/537.36
Query String Parametersview sourceview URL encoded
g:oxp-css-ltr
v:2.8.11
Run Code Online (Sandbox Code Playgroud)

以下是Chrome作为网页的一部分执行时不能很好地执行的Buggy LInk

[link rel ="stylesheet"type ="text/css"href ="http://localhost/openx/www/admin/assets/min.php?g = oxp-css-ltr&v = 2.8.11]

但是当我直接访问时,它会正确返回Headers.我无法弄清楚为什么会那样?

更新

我使用LIVE HTTPHEADERS扩展来获取内容,如下所示:

GET /openx/www/admin/assets/min.php?g=oxp-css-ltr&v=2.8.11 HTTP/1.1
Host: localhost
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,ur;q=0.6
Cache-Control: no-cache
Cookie: PHPSESSID=87eb59b22ac0ce0d57ecf1e422a412a7; ox_install_session_id=341ef9a68cffdbd9b47d6076e0f12d40; sessionID=b7ccb4b31bc58e5958ec84d44110100f
Pragma: no-cache
User-Agent: …
Run Code Online (Sandbox Code Playgroud)

google-chrome

8
推荐指数
1
解决办法
4万
查看次数

如何防止angularjs ajax调用中显示"临时标题"

我试图在angularjs应用程序中进行ajax调用.但随机我得到这个警告说"显示临时标题",并且每当调试器控制台中出现此警告时,我的服务器响应速度非常慢(大约30到45秒).并且它在10次试验期间发生了大约6次.

这是我的angularjs代码片段: -

var request = $http({
                  method:"post",
                  url:"/getdata.php",
                  data:filterpara,                              
                  headers: {'Content-Type' : 'application/x-www-form-urlencoded'}                       
            }); 

        request.success(function(data){ 

                    console.log(data);

        });
Run Code Online (Sandbox Code Playgroud)

这种类型的代码我在不同的控制器中使用了很多次.但随机相同的问题也出现在不同的控制器中.我无法弄清楚为什么会这样?

我也尝试过这些链接提供的解决方案(但没有运气): -

节点js/Angular js - 注意:显示临时标题(我面临的这种问题)

"小心:Chrome调试器中显示了临时标题"

javascript ajax angularjs

8
推荐指数
1
解决办法
8913
查看次数

使用ASP.NET MVC在FileStreamResult中使用SqlDataReader时,请求未完成

出于性能考虑,我正在使用SqlConnection从SQL Server数据库SqlReaderStream返回一个byte[] :

private static SqlConnection GetConnection()
{
    var sqlConnectionStringBuilder =
        new SqlConnectionStringBuilder(
            ConfigurationManager.ConnectionStrings["StudentsSystemEntities"].ConnectionString)
            {
                Pooling = true
            };
    var connection = new SqlConnection(sqlConnectionStringBuilder.ConnectionString);
    connection.Open();
    return connection;
}

public FileDownloadModel GetFileById(Guid fileId)
{
    var connection = GetConnection();
    var command = new SqlCommand(
        @"SELECT [FileSize], [FileExtension], [Content] FROM [dbo].[Files] WHERE [FileId] = @fileId;",
        connection);
    var paramFilename = new SqlParameter(@"fileId", SqlDbType.UniqueIdentifier) { Value = fileId };
    command.Parameters.Add(paramFilename);

    var reader = command.ExecuteReader(
        CommandBehavior.SequentialAccess | CommandBehavior.SingleResult
        | …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc sqlconnection http filestream

7
推荐指数
2
解决办法
1459
查看次数

节点js/Angular js - 注意:显示临时标头

这是我的Angular js片段代码:

$http({
                method:'POST',
                withCredential:true,
                url:$scope.config.app_ws+'auth/signup',
                data:{user:$scope.auth}
            }).success(function(status, response){

                console.log(response);
            }).error(function(status, response){
                alert(response+'Bummer :( , an error occured plese retry later. ');
            });
Run Code Online (Sandbox Code Playgroud)

这是我的Node.js片段后端:

 var allow_cross_domain= function(req, res, next) {
      res.header('X-Powered-By', 'hey.heyssssssss.org');

      var oneof = false;
      if(req.headers.origin) {
        res.header('Access-Control-Allow-Origin', req.headers.origin);
        oneof = true;
      }
      if(req.headers['access-control-request-method']) {
        res.header('Access-Control-Allow-Methods', req.headers['access-control-request-method']);
        oneof = true;
      }
      if(req.headers['access-control-request-headers']) {
        res.header('Access-Control-Allow-Headers', req.headers['access-control-request-headers']);
        oneof = true;
      }
      if(oneof) {
        res.header('Access-Control-Max-Age', 60 * 60 * 24 * 365);
      }
    // intercept OPTIONS method
    if …
Run Code Online (Sandbox Code Playgroud)

javascript xmlhttprequest http-headers node.js angularjs

5
推荐指数
1
解决办法
2万
查看次数

注意:显示临时标题

我不能调试这个消息,就像一个星期前一样.

我尝试恢复到旧文件,但这很奇怪,没有解决我的问题.

所以:我有两个长轮询请求.(关闭其中一个没有帮助).

例如,这是其中之一:

public function update_private_messages_ajax_handler(){
    global $wpdb;
    global $bp;
    $chat_table = $wpdb->prefix . 'bp_dollars_chat';

    $current_user = $bp->loggedin_user->id;

    ob_start();
    header("Content-Type: application/json");
    header("Cache-Control: no-cache, must-revalidate");
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

    $startTime = time();
    while((time()-$startTime)<=20) {
        $messages = $wpdb->get_results(
            $wpdb->prepare("(SELECT * 
                FROM $chat_table 
                WHERE to_user = %d
                AND recd = 1
                AND id > %d
                ORDER BY id DESC) ORDER BY id ASC
            ", $current_user, $_POST['last_id'])
        );
        if($messages) {
            foreach($messages as $v){
                //$v->timestring = date_i18n($this->date_format.' - '.$this->time_format, $v->unix_timestamp+$this->gmt_offset);
                $v->name …
Run Code Online (Sandbox Code Playgroud)

php ajax comet long-polling google-chrome-devtools

3
推荐指数
2
解决办法
7万
查看次数

Puppeteer 浏览器引用列表

我想referers从我的默认位置路径加载随机列表,例如:'referers.txt'而不是直接添加“facebook url 作为引用者。

我的代码:

browser = await puppeteer.getBrowserInstance(port);
const page = await browser.newPage();
page.setDefaultTimeout(PAGE_DEFAULT_TIMEOUT * 1000);
page.on('error', handlePageCrash(page));
page.on('pageerror', handlePageCrash(page));
page.setExtraHTTPHeaders({ referer: 'https://www.facebook.com/' });
Run Code Online (Sandbox Code Playgroud)

javascript referer node.js puppeteer

3
推荐指数
1
解决办法
4422
查看次数