javascript - Jquery a href onclick to controller without reload page -
i trying write code includes confirm message using jquery.
İf ı click exit according below code occurs reload of page.
<a href="exit" onclick="return confirm('are sure want exit?')">exit</a> how can ı write above code without reload page confirm message in jquery ?
İf confirm ok = go href (without reload) İf confirm cancel = cancel it,
try following code
<a href="#exit" onclick="return confirm('are sure want exit?'); return false">exit</a> explanation:
# url fragment name preceded hash mark (#), specifies internal target location (an id) within current document.
while return false way tell event not fire.
Comments
Post a Comment