<div dir="ltr">I think if I use this method, it will still alert the user even there are no changes made by the user.<div><br></div><div><br></div><div>Regards,</div><div style>Hua Jie</div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Wed, Apr 17, 2013 at 5:47 PM, Grégory COLLIN <span dir="ltr"><<a href="mailto:gcollin@v3d.fr" target="_blank">gcollin@v3d.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le Wed, 17 Apr 2013 05:49:15 +0200,<br>
杨华杰 <<a href="mailto:yhjhoo@gmail.com">yhjhoo@gmail.com</a>> a écrit :<br>
<div><div class="h5"><br>
> I want to alert my user if they close the window without save the<br>
> changes.<br>
><br>
><br>
> Is it possible to detect the changes? And how?<br>
><br>
> Welcome any tips<br>
><br>
> Regards,<br>
> Hua Jie<br>
<br>
</div></div>Hi Hua,<br>
<br>
You can use the javascript event beforeunload to alert your user.<br>
I used mine, like this :<br>
<br>
$(window).bind('beforeunload',function(e){}<br>
<br>
Regards,<br>
<br>
Greg<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote></div><br></div>