根据用户操作,我需要进行从一个调用到三个并行调用的ajax调用。我也想显示进度条。一个进度条用于任意数量的Ajax请求。下面是我要调整的示例代码。谁能建议我如何限制呼叫的数量,以及如何使用一个进度条来实现这一点。
$.when(
// Get the HTML
$.get("/feature/", function(html) {
globalStore.html = html;
}),
// Get the CSS
$.get("/assets/feature.css", function(css) {
globalStore.css =
我在第三方库的帮助下创建了一个React进度条。
import React from "react";
import { css } from "@emotion/core";
import ClipLoader from "react-spinners/ClipLoader";
// Can be a string as well. Need to ensure each key-value pair ends with ;
const override = css`
display: block;
margin: 0 auto
当我的网站加载一个div在div显示之前隐藏了x秒,我只是想让它在x秒后有一个进度条,这个进度条会保持100%,然后div会显示出来,我该怎么做呢?
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script>
$(document).ready(function () {
// Hide the div
$("#sidebar-block").hide();
// Show the div after