如何通过保留控制台日志将页面重定向到开始页面? [英] Ho to redirect page to beginning page by keeping console logs?

查看:95
本文介绍了如何通过保留控制台日志将页面重定向到开始页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在进行此类调查;不严重。第一页是介绍页面,我说欢迎,blablabla。第二页询问姓名和职业。第三页,我会问每个人questinos,并选择答案,他们必须检查单选按钮(每个单选按钮是从1/10到10/10的成绩)。一旦他们选择了他们的答案并点击提交,他们的答案将是console.logged。当他们点击提交时,第三个html消失,另外四个HTML出现(说感谢参加调查)。我希望第四个html在10秒之后自动重定向到第一个介绍页面。然后,整个循环重新开始。



这可能吗?也许用Javascript / jQuery?



所有这些都在一个HTML,CSS和JS文件中(我希望它就像那样)。



非常感谢你。



我的尝试:



并不多,因为我的研究完全没有结果。我甚至不知道从哪里开始。

Hi guys,

I'm making this type of survey; nothing serious. First page is the intro page where i say welcome, blablabla. Second page asks name and occupation. Third page, i'll ask everybody questinos, and to choose answers, they<ll have to check radio buttons (each radio button is a grade from 1/10 to 10/10). Once they choose their answers and click submit, their answers will have been console.logged. When they click submit, this third html disappears and another fourth HTML appears (saying stuff like thank for taking the survey). I want that fourth html to automatically redirect to the first, intro page after, say, 10 seconds. Then, the whole cycle restarts.

Is that possible? Maybe with Javascript/jQuery?

All this is in one HTML, CSS, and JS file ( I want it to be like that).

Thank you so much.

What I have tried:

Not much, as my research has been completely fruitless. I don't even know where to start.

推荐答案

在您希望重定向的最后一页上,您需要使用setTimeOut函数。所以你会做类似



On your last page that you wish to redirect you'd need to use the setTimeOut function. So you'd do something like

setTimeout(function(){
   window.location.replace("http://url/to/the/first/page/of/your/survey.html");
}, 10000);





其中10000是执行前等待的时间。所以,如果你想等待15秒钟,那么它将是15000,因为这个值是以毫秒为单位。



Where 10000 is the amount of time it will wait before executing. So if you wanted 15 second wait, then it would be 15000 as this value is in milliseconds.


这篇关于如何通过保留控制台日志将页面重定向到开始页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆