jquery confirm and exit functionality -


is shown in the HTML page, where is the window .onbeforeunload = confirmExit to be placesd When a certified DAV is shown, the warning message is not shown on the user's cancellation or save button. And if the user clicks or another link alert message should be shown

If any other link MCAXAX click () function should be called and then continue

  & Lt; Div id = "start" & gt; & Lt; / Div & gt; & Lt; Div id = "valid" & gt; & Lt; Input type = "button" / value = "cancel" onclick = "window.locatcation = 'cancel ()'" & gt; & Lt; Input type = "button" / value = "save" onclick = "save ()" & gt; & Lt; / Div & gt; & Lt; Div id = "confirm" & gt; & Lt; / Div & gt; & Lt; Input type = "hidden" name = "local exchanges" id = "local exchanges" value = "1" & gt; & Lt; Script & gt; Cancel Function () {$ ('Lowchange') Val ('0'); Makeajaxcall (); } Function makexxall () {} Send request to server and receive response $ $ (document) .ready ({if (load_flag == 2) {$ ("# valid"). CSS ({'display': block}) ; $ ("#start"). CSS ({'display': none}}; $ ("# confirm"). Css ({'display': none)} window ;onbeforeunload = confirmExit;}}) ; Confirm functionExit () {var ele = document.getElementById ("local behavior"); If (ele.value == "1") return "You have not made any changes. Skip change?" ; } & Lt; / Script & gt;    

in $ (document) .ready () , your The syntax is incorrect,

you forgot to type function . .ready (function () {....});

  $ (document) .ready (function () {if (load_flag == 2) {$ ("# validate"). CSS ({'display': 'block $ ("#"); $ ("'Display': 'none'}); $ (" # confirmation "). Css ({'display': 'none'}); window Onforeforeload = confirmExit;}});  

Comments