我正在写我自己的网站作为家庭作业,我的老师让我写一个计算页面加载时间的脚本,并在页脚上写它,我用JS写它,但我想用Jquery写它,但我不知道怎么做。下面是我使用JS的代码:
let loadTime = (function () {
let now = new Date().getTime();
let page_load_time = now - performance.timeOrigin
let time_load = page_load_time / 1000;
return time_load.toFixed(4);
})();
我用npm安装了第三方库。例如,我想在我的页面上导入"https://github.com/xkeshi/image-compressor“上的库。但是我在页面开头写的"import‘ImageCompressor -Compressor.js“错误显示了"window is not defined”错误。 如何在NextJS中获取第三方库?
我正在制作一个应用程序,通过查看来跨越几个页面。
错误发生了
Failed to compile
./src/Router.js
Module not found: Can't resolve './pages/pageA' in '/Users/xxx/app/frontend/src'
我用src/Router.js写的
import React, { Scene, Router, Actions } from 'react';
import pageA from './pages/pageA';
import p