You can not. The problem is that each page loads in its own logical window (even if this window occupies the same client area in the browser as the previous page). Each window runs a script in its own context. Usually, when windows are replaced, any running script exits, and even if I didn’t suspect that you want the code following the location to work on the new content.
. dyanmically - PHP ASP, , , SRC script, .