Calling a javascript function after loading a page with [removed].assign

前端 未结 3 1494
星月不相逢
星月不相逢 2021-01-22 09:06

Is it possible to call a javascript function after loading a page with window.location.assign? I have this code.



        
3条回答
  •  抹茶落季
    2021-01-22 09:28

    No. The javascript past window.location.assign will never get read. This function actually makes you leave the page and navigate to the argument.

    If you want to stay on the current page and have access to some javascript on spirituality.php you will need to load it via AJAX. If you actually are trying to navigate to 'spirituality.php' and load ReadEnglish();, you need to call the function on spirituality.php

提交回复
热议问题