Code Monkey home page Code Monkey logo

Comments (9)

Axoloteera avatar Axoloteera commented on July 21, 2024

等下,经过我的测试在任何情况下,该用户数据没加载过都是这样,可能跟上述条件无关

from aerfaying-explore.

waterblock79 avatar waterblock79 commented on July 21, 2024

不太好复现,能提供一下图里的URL吗(

from aerfaying-explore.

waterblock79 avatar waterblock79 commented on July 21, 2024

第 71 行我写了一个判断是否保存了这个信息的,不知道为什么没生效?

            // 如果这个用户的信息没被存下,那就发送请求获取数据
            if( window.userInfoCache[userId] == undefined ) {
                let cId = data.parentElement.parentElement.id; // 请求里面的 data 给代表这个链接元素的外面的 data 覆盖掉了......
                $.ajax({ url: `/WebApi/Users/${e.target.href.match(/[0-9]+/g)[0]}/Get`, method: 'post', success: (data) => {
                    addUserBox( data, cId );
                    // 存好这个用户的数据,下回就不再请求了
                    window.userInfoCache[userId] = data;
                } });
            } else {
                addUserBox( window.userInfoCache[userId], data.parentElement.parentElement.id )
            }

from aerfaying-explore.

Axoloteera avatar Axoloteera commented on July 21, 2024

有时不会出现。我现在认为出现这个情况能不能提示一个“加载错误”,不然太生硬了(

from aerfaying-explore.

Axoloteera avatar Axoloteera commented on July 21, 2024

现在又来了,这是一个使用奥灰的随机展览位上的用户名出现的:
image

from aerfaying-explore.

Axoloteera avatar Axoloteera commented on July 21, 2024

这样测试:
首先登录到gitblock.cn
然后打开https://gitblock.cn/Users/1226979#commentId=4031598
找到评论:
image
然后试试。
假如之前进行这个测试的话,再次测试就没问题。可过几天又会这样。

from aerfaying-explore.

Axoloteera avatar Axoloteera commented on July 21, 2024

现在据我尝试,如果这个用户数据在本地没有储存,就会这样,刷新后这个用户的数据又好了(

from aerfaying-explore.

Axoloteera avatar Axoloteera commented on July 21, 2024

当然我不是很清楚您写的代码,有没有可能它是加载完本地空数据渲染完再去发送请求的(

from aerfaying-explore.

waterblock79 avatar waterblock79 commented on July 21, 2024

okok,我找到错误的原因了,已修复,感谢

from aerfaying-explore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.