How to execute some jQuery or JavaScript code after a redirect has completed -
how can execute jquery/js code jquery/js redirect like...
$(location).attr('href','/target_path');
...or...
window.location.href = "/target_path";
...has finished loading new page?
specifically, need pass alert message , insert , display (enclosed in html) on new page.
it impossible tell javascript execute code after redirect.
however have different options:
- pass string in redirect url , on "ready"
- store information in cookie , on "ready"
- store data using dom storage (namely
sessionstorage
) if don't mind smaller browser support
Comments
Post a Comment