Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
检查条件后如何在javascript中转到下一页。
我是 javascript 的新学生,所以请告诉我如何做到这一点。发送一个易于学习的示例。
尝试这个
if(conditionIsTrue){ window.location.href = '...'; }
这将检查“conditionIsTrue”是否为真,然后将您发送到您放置在下一行中的 URL。