js in thymeleaf jumps to another page

<script type="text/javascript">
  setTimeout("location.href='index'", 3000);
</script>

This method is to change the last suffix of the current path into index, which has certain limitations

下面这种方法 通用
<script type="text/javascript" th:inline="javascript">
function saveReply(){
  /*<![CDATA[*/var loginhref= /*[[@{/login}]]*/"arclist/";   /*]]>*/   if(flag){location.href=loginhref;   }}</script>
    



    


 

Original article, welcome to reprint, please indicate the source!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324992027&siteId=291194637