如何用js跳转到指定页面然后触发某一个事件

如何用js跳转到指定页面然后触发某一个事件希望大神教教我谢谢

跳转至 a.html 并在 a.html 中触发 onload 事件:

// index.html
window.location.href = './a.html';

// a.html
window.onload = function () {
    console.log('窗口已加载完毕!');
}

温馨提示:答案为网友推荐,仅供参考
相似回答