Click here to Skip to main content
15,880,364 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

i need to call javascript function on change of browser url suppose user change url from browser bar then before anything happens javascript function should be call first
Posted
Comments
Dholakiya Ankit 13-Jul-13 1:33am    
yes got solution via beforeunload

Hi,
From my knowledge there is no possible functions to call when user changes the URL from browser bar.

You can try with onpageunload function for unmatching sequence of URL.
 
Share this answer
 
Well there is no event exist in JavaScript for above mentioned scenario.You can try window.onbeforeunload event which get fired when a window is about to unload but this event will also get fire in case user refresh the page and that you need to handle yourself. Check below link for reference

window.onbeforeunload[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900